$estr = function() { return js.Boot.__string_rec(this,''); }
StringTools = function() { }
StringTools.__name__ = ["StringTools"];
StringTools.urlEncode = function(s) {
	return encodeURIComponent(s);
}
StringTools.urlDecode = function(s) {
	return decodeURIComponent(s.split("+").join(" "));
}
StringTools.htmlEscape = function(s) {
	return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}
StringTools.htmlUnescape = function(s) {
	return s.split("&gt;").join(">").split("&lt;").join("<").split("&amp;").join("&");
}
StringTools.startsWith = function(s,start) {
	return (s.length >= start.length && s.substr(0,start.length) == start);
}
StringTools.endsWith = function(s,end) {
	var elen = end.length;
	var slen = s.length;
	return (slen >= elen && s.substr(slen - elen,elen) == end);
}
StringTools.isSpace = function(s,pos) {
	var c = s.charCodeAt(pos);
	return (c >= 9 && c <= 13) || c == 32;
}
StringTools.ltrim = function(s) {
	var l = s.length;
	var r = 0;
	while(r < l && StringTools.isSpace(s,r)) {
		r++;
	}
	if(r > 0) return s.substr(r,l - r);
	else return s;
}
StringTools.rtrim = function(s) {
	var l = s.length;
	var r = 0;
	while(r < l && StringTools.isSpace(s,(l - r) - 1)) {
		r++;
	}
	if(r > 0) {
		return s.substr(0,l - r);
	}
	else {
		return s;
	}
}
StringTools.trim = function(s) {
	return StringTools.ltrim(StringTools.rtrim(s));
}
StringTools.rpad = function(s,c,l) {
	var sl = s.length;
	var cl = c.length;
	while(sl < l) {
		if(l - sl < cl) {
			s += c.substr(0,l - sl);
			sl = l;
		}
		else {
			s += c;
			sl += cl;
		}
	}
	return s;
}
StringTools.lpad = function(s,c,l) {
	var ns = "";
	var sl = s.length;
	if(sl >= l) return s;
	var cl = c.length;
	while(sl < l) {
		if(l - sl < cl) {
			ns += c.substr(0,l - sl);
			sl = l;
		}
		else {
			ns += c;
			sl += cl;
		}
	}
	return ns + s;
}
StringTools.replace = function(s,sub,by) {
	return s.split(sub).join(by);
}
StringTools.hex = function(n,digits) {
	var s = "";
	var hexChars = "0123456789ABCDEF";
	do {
		s = hexChars.charAt(n & 15) + s;
		n >>>= 4;
	} while(n > 0);
	if(digits != null) while(s.length < digits) s = "0" + s;
	return s;
}
StringTools.prototype.__class__ = StringTools;
if(typeof org=='undefined') org = {}
if(!org.casalib) org.casalib = {}
if(!org.casalib.util) org.casalib.util = {}
org.casalib.util.StringUtil = function() { }
org.casalib.util.StringUtil.__name__ = ["org","casalib","util","StringUtil"];
org.casalib.util.StringUtil.toTitleCase = function(source,lowerCaseSmallWords) {
	if(lowerCaseSmallWords == null) lowerCaseSmallWords = true;
	source = org.casalib.util.StringUtil._checkWords(source," ",true,lowerCaseSmallWords);
	var parts = source.split(" ");
	var last = parts.length - 1;
	if(!org.casalib.util.StringUtil._isIgnoredWord(parts[0])) parts[0] = org.casalib.util.StringUtil._capitalizeFirstLetter(parts[0]);
	if(!org.casalib.util.StringUtil._isIgnoredWord(parts[last]) && (!lowerCaseSmallWords || !org.casalib.util.StringUtil._isSmallWord(parts[last]))) parts[last] = org.casalib.util.StringUtil._capitalizeFirstLetter(parts[last]);
	source = parts.join(" ");
	if(source.split(": ").length - 1 > 0) {
		var i = -1;
		parts = source.split(": ");
		while(++i < parts.length) parts[i] = org.casalib.util.StringUtil._capitalizeFirstLetter(parts[i]);
		source = parts.join(": ");
	}
	return source;
}
org.casalib.util.StringUtil._checkWords = function(source,delimiter,checkForDashes,lowerCaseSmallWords) {
	if(lowerCaseSmallWords == null) lowerCaseSmallWords = false;
	if(checkForDashes == null) checkForDashes = false;
	var words = source.split(delimiter);
	var l = words.length;
	var word;
	while(l-- > 0) {
		word = words[l];
		words[l] = org.casalib.util.StringUtil._checkWord(word,checkForDashes,lowerCaseSmallWords);
	}
	return words.join(delimiter);
}
org.casalib.util.StringUtil._checkWord = function(word,checkForDashes,lowerCaseSmallWords) {
	if(org.casalib.util.StringUtil._isIgnoredWord(word)) return word;
	if(lowerCaseSmallWords) if(org.casalib.util.StringUtil._isSmallWord(word)) return word.toLowerCase();
	if(checkForDashes) {
		var dashes = ["-","–","—"];
		var i = -1;
		var dashFound = false;
		while(++i < dashes.length) {
			if(word.split(dashes[i]).length - 1 != 0) {
				word = org.casalib.util.StringUtil._checkWords(word,dashes[i],false,true);
				dashFound = true;
			}
		}
		if(dashFound) return word;
	}
	return org.casalib.util.StringUtil._capitalizeFirstLetter(word);
}
org.casalib.util.StringUtil._isIgnoredWord = function(word) {
	var periodIndex = word.indexOf(".");
	var upperIndex = org.casalib.util.StringUtil.indexOfUpperCase(word);
	if(periodIndex != -1 && periodIndex != word.length - 1 || upperIndex != -1 && upperIndex != 0) return true;
	return false;
}
org.casalib.util.StringUtil._isSmallWord = function(word) {
	return org.casalib.util.ArrayUtil.indexOf(["a","an","and","as","at","but","by","en","for","if","is","in","of","on","or","the","to","v","via","vs"],org.casalib.util.StringUtil.getLettersFromString(word).toLowerCase()) > -1;
}
org.casalib.util.StringUtil._capitalizeFirstLetter = function(source) {
	var i = -1;
	while(++i < source.length) if(!org.casalib.util.StringUtil.isPunctuation(source.charAt(i))) return (source.substr(0,i) + source.charAt(i).toUpperCase()) + source.substr(i + 1);
	return source;
}
org.casalib.util.StringUtil.uuid = function() {
	var specialChars = ["8","9","A","B"];
	return ((((((((org.casalib.util.StringUtil.createRandomIdentifier(8,15) + "-") + org.casalib.util.StringUtil.createRandomIdentifier(4,15)) + "-4") + org.casalib.util.StringUtil.createRandomIdentifier(3,15)) + "-") + specialChars[Math.round((Math.random() * 3))]) + org.casalib.util.StringUtil.createRandomIdentifier(3,15)) + "-") + org.casalib.util.StringUtil.createRandomIdentifier(12,15);
}
org.casalib.util.StringUtil.createRandomIdentifier = function(length,radix) {
	if(radix == null) radix = 61;
	var characters = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
	var id = new Array();
	radix = ((radix > 61)?61:radix);
	while(length-- > 0) {
		id.push(characters[Math.round((Math.random() * (radix)))]);
	}
	return id.join("");
}
org.casalib.util.StringUtil.autoLink = function(source,window,className) {
	if(window == null) window = "_blank";
	var pattern = new EReg("\\b(([\\w-]+\\://?|www[.])[^\\s()<>]+(?:\\([\\w\\d]+\\)|([^[:punct:]\\s]|/)))","g");
	className = ((className != "" && className != null)?(" class=\"" + className) + "\"":"");
	window = ((window != null)?(" target=\"" + window) + "\"":"");
	return pattern.replace(source,(("<a href=\"$1\"" + window) + className) + ">$1</a>");
}
org.casalib.util.StringUtil.htmlEncode = function(source) {
	return StringTools.htmlEscape(source);
}
org.casalib.util.StringUtil.htmlDecode = function(source) {
	return StringTools.htmlUnescape(source);
}
org.casalib.util.StringUtil.isPunctuation = function(source,allowSpaces) {
	if(allowSpaces == null) allowSpaces = true;
	var pAry = "[-!\"#$%&'()*+,./:;<=>?@[\\]^_`{|}~]".split("");
	if(allowSpaces) pAry.push(" ");
	return !org.casalib.util.ArrayUtil.retainItems(source.split(""),pAry);
}
org.casalib.util.StringUtil.isUpperCase = function(source) {
	return !(source != source.toUpperCase());
}
org.casalib.util.StringUtil.isLowerCase = function(source) {
	return !(source != source.toLowerCase());
}
org.casalib.util.StringUtil.isNumber = function(source) {
	var trimmed = org.casalib.util.StringUtil.trim(source,null);
	if(source.length == 0 || org.casalib.util.StringUtil.trim(source,null).length < source.length) {
		return false;
	}
	else {
		var num = Std.parseFloat(source);
		if(Math.isNaN(num)) return false;
		if(num != 0) return true;
		source = source.toLowerCase();
		if(org.casalib.util.ArrayUtil.retainItems(source.split(""),["0",".","-","x","f"])) return false;
		if(!(org.casalib.util.ArrayUtil.retainItems(source.split(""),["0"]))) return true;
		if(source.length == 1 && source != "0") return false;
		if(source.indexOf("0") == -1) return false;
		if(source.lastIndexOf("-") > 0) return false;
		var oxo = source.indexOf("0x0");
		if(oxo != -1) {
			var noOxO = (source.substr(0,oxo) + source.substr(oxo + 3)).split("");
			if(org.casalib.util.ArrayUtil.retainItems(noOxO,["0",".","-"])) return false;
		}
		if(source.split(".").length - 1 > 1) return false;
		var indF = source.indexOf("f");
		if(indF != -1 && indF < source.length - 1) return false;
		return true;
	}
}
org.casalib.util.StringUtil.indexOfUpperCase = function(source,startIndex) {
	if(startIndex == null) startIndex = 0;
	var letters = source.split("");
	var i = startIndex - 1;
	while(++i < letters.length) if(letters[i] == letters[i].toUpperCase() && letters[i] != letters[i].toLowerCase()) return i;
	return -1;
}
org.casalib.util.StringUtil.indexOfLowerCase = function(source,startIndex) {
	if(startIndex == null) startIndex = 0;
	var letters = source.split("");
	var i = startIndex - 1;
	while(++i < letters.length) if(letters[i] == letters[i].toLowerCase() && letters[i] != letters[i].toUpperCase()) return i;
	return -1;
}
org.casalib.util.StringUtil.getNumbersFromString = function(source) {
	var pattern = new EReg("[^0-9]","g");
	return pattern.replace(source,"");
}
org.casalib.util.StringUtil.getLettersFromString = function(source) {
	var pattern = new EReg(("[[0-9]|" + StringTools.urlDecode("%5B+%21%22%23%24%25%26%27%28%29*%2B%2C%5C-.%2F%3A%3B%3C%3D%3E%3F%40%5B%5C%5C%5C%5D%5E_%60%7B%7C%7D%7E%5D")) + "|\\s]","g");
	return pattern.replace(source,"");
}
org.casalib.util.StringUtil.contains = function(source,search) {
	return source.split(search).length - 1;
}
org.casalib.util.StringUtil.trimLeft = function(source,removeChars) {
	if(removeChars == null) removeChars = " \t\n\r";
	var pattern = new EReg(("^[" + removeChars) + "]+","");
	return pattern.replace(source,"");
}
org.casalib.util.StringUtil.trimRight = function(source,removeChars) {
	if(removeChars == null) removeChars = " \t\n\r";
	var pattern = new EReg(("[" + removeChars) + "]+$","");
	return pattern.replace(source,"");
}
org.casalib.util.StringUtil.trim = function(source,removeChars) {
	if(removeChars == null) removeChars = " \t\n\r";
	var pattern = new EReg(((("^[" + removeChars) + "]+|[") + removeChars) + "]+$","g");
	return pattern.replace(source,"");
}
org.casalib.util.StringUtil.removeExtraSpaces = function(source) {
	var pattern = new EReg("( )+","g");
	return org.casalib.util.StringUtil.trim(pattern.replace(source," ")," ");
}
org.casalib.util.StringUtil.removeWhitespace = function(source) {
	var pattern = new EReg(("[" + " \t\n\r") + "]","g");
	return pattern.replace(source,"");
}
org.casalib.util.StringUtil.remove = function(source,remove) {
	return source.split(remove).join("");
}
org.casalib.util.StringUtil.replace = function(source,remove,replace) {
	return source.split(remove).join(replace);
}
org.casalib.util.StringUtil.removeAt = function(source,position) {
	return (source.substr(0,position) + "") + source.substr(position + 1);
}
org.casalib.util.StringUtil.replaceAt = function(source,position,replace) {
	return (source.substr(0,position) + replace) + source.substr(position + 1);
}
org.casalib.util.StringUtil.addAt = function(source,position,addition) {
	return (source.substr(0,position) + addition) + source.substr(position);
}
org.casalib.util.StringUtil.getWordCount = function(source) {
	return org.casalib.util.StringUtil.removeExtraSpaces(org.casalib.util.StringUtil.trim(source,null)).split(" ").length;
}
org.casalib.util.StringUtil.getUniqueCharacters = function(source) {
	var unique = "";
	var i = 0;
	var $char;
	while(i < source.length) {
		$char = source.charAt(i);
		if(unique.indexOf($char) == -1) unique += $char;
		i++;
	}
	return unique;
}
org.casalib.util.StringUtil.stripTags = function(str,allowed_tags) {
	if(allowed_tags == null) allowed_tags = "";
	var key = "", allowed = false;
	var matches = [];
	var allowed_array = [];
	var allowed_tag = "";
	var i = 0;
	var k = "";
	var html = "";
	var replacer = function(search,replace,str1) {
		return str1.split(search).join(replace);
	}
	if(allowed_tags != "") {
		var regexp = new EReg("([a-zA-Z0-9]+)","i");
		var _str = allowed_tags;
		while(regexp.match(_str)) {
			var m = regexp.matched(0);
			allowed_array.push(m);
			_str = regexp.matchedRight();
		}
	}
	var regexp = new EReg("(</?[\\S][^>]*>)","i");
	var _str = str;
	while(regexp.match(_str)) {
		var m = regexp.matched(0);
		matches.push(m);
		_str = regexp.matchedRight();
	}
	{
		var _g1 = 0, _g = matches.length;
		while(_g1 < _g) {
			var key1 = _g1++;
			html = matches[key1];
			allowed = false;
			{
				var _g3 = 0, _g2 = allowed_array.length;
				while(_g3 < _g2) {
					var k1 = _g3++;
					allowed_tag = allowed_array[k1];
					i = -1;
					if(i != 0) {
						i = html.toLowerCase().indexOf(("<" + allowed_tag) + ">");
					}
					if(i != 0) {
						i = html.toLowerCase().indexOf(("<" + allowed_tag) + " ");
					}
					if(i != 0) {
						i = html.toLowerCase().indexOf("</" + allowed_tag);
					}
					if(i == 0) {
						allowed = true;
						break;
					}
				}
			}
			if(!allowed) {
				str = replacer(html,"",str);
			}
		}
	}
	return str;
}
org.casalib.util.StringUtil.prototype.__class__ = org.casalib.util.StringUtil;
Reflect = function() { }
Reflect.__name__ = ["Reflect"];
Reflect.hasField = function(o,field) {
	if(o.hasOwnProperty != null) return o.hasOwnProperty(field);
	var arr = Reflect.fields(o);
	{ var $it0 = arr.iterator();
	while( $it0.hasNext() ) { var t = $it0.next();
	if(t == field) return true;
	}}
	return false;
}
Reflect.field = function(o,field) {
	var v = null;
	try {
		v = o[field];
	}
	catch( $e0 ) {
		{
			var e = $e0;
			null;
		}
	}
	return v;
}
Reflect.setField = function(o,field,value) {
	o[field] = value;
}
Reflect.callMethod = function(o,func,args) {
	return func.apply(o,args);
}
Reflect.fields = function(o) {
	if(o == null) return new Array();
	var a = new Array();
	if(o.hasOwnProperty) {
		
				for(var i in o)
					if( o.hasOwnProperty(i) )
						a.push(i);
			;
	}
	else {
		var t;
		try {
			t = o.__proto__;
		}
		catch( $e0 ) {
			{
				var e = $e0;
				{
					t = null;
				}
			}
		}
		if(t != null) o.__proto__ = null;
		
				for(var i in o)
					if( i != "__proto__" )
						a.push(i);
			;
		if(t != null) o.__proto__ = t;
	}
	return a;
}
Reflect.isFunction = function(f) {
	return typeof(f) == "function" && f.__name__ == null;
}
Reflect.compare = function(a,b) {
	return ((a == b)?0:((((a) > (b))?1:-1)));
}
Reflect.compareMethods = function(f1,f2) {
	if(f1 == f2) return true;
	if(!Reflect.isFunction(f1) || !Reflect.isFunction(f2)) return false;
	return f1.scope == f2.scope && f1.method == f2.method && f1.method != null;
}
Reflect.isObject = function(v) {
	if(v == null) return false;
	var t = typeof(v);
	return (t == "string" || (t == "object" && !v.__enum__) || (t == "function" && v.__name__ != null));
}
Reflect.deleteField = function(o,f) {
	if(!Reflect.hasField(o,f)) return false;
	delete(o[f]);
	return true;
}
Reflect.copy = function(o) {
	var o2 = { }
	{
		var _g = 0, _g1 = Reflect.fields(o);
		while(_g < _g1.length) {
			var f = _g1[_g];
			++_g;
			o2[f] = Reflect.field(o,f);
		}
	}
	return o2;
}
Reflect.makeVarArgs = function(f) {
	return function() {
		var a = new Array();
		{
			var _g1 = 0, _g = arguments.length;
			while(_g1 < _g) {
				var i = _g1++;
				a.push(arguments[i]);
			}
		}
		return f(a);
	}
}
Reflect.prototype.__class__ = Reflect;
org.casalib.util.NumberUtil = function() { }
org.casalib.util.NumberUtil.__name__ = ["org","casalib","util","NumberUtil"];
org.casalib.util.NumberUtil.isEqual = function(val1,val2,precision) {
	if(precision == null) precision = 0;
	return Math.abs(val1 - val2) <= Math.abs(precision);
}
org.casalib.util.NumberUtil.min = function(val1,val2) {
	if(val1 == Math.NaN && val2 == Math.NaN || val1 == null && val2 == null) return Math.NaN;
	if(val1 == null || val2 == null) return ((val2 == null)?val1:val2);
	if(val1 == Math.NaN || val2 == Math.NaN) return (val2 == Math.NaN?val1:val2);
	if(!Std["is"](val1,Float) || !Std["is"](val2,Float)) return (Std["is"](val1,Float)?val1:val2);
	return Math.min(val1,val2);
}
org.casalib.util.NumberUtil.max = function(val1,val2) {
	if(val1 == Math.NaN && val2 == Math.NaN || val1 == null && val2 == null) return Math.NaN;
	if(val1 == null || val2 == null) return ((val2 == null)?val1:val2);
	if(val1 == Math.NaN || val2 == Math.NaN) return ((val2 == Math.NaN)?val1:val2);
	if(!Std["is"](val1,Float) || !Std["is"](val2,Float)) return (Std["is"](val1,Float)?val1:val2);
	return Math.max(val1,val2);
}
org.casalib.util.NumberUtil.randomWithinRange = function(min,max) {
	return min + (Math.random() * (max - min));
}
org.casalib.util.NumberUtil.randomIntegerWithinRange = function(min,max) {
	return Math.round(min + (Math.random() * (max - min)));
}
org.casalib.util.NumberUtil.isEven = function(value) {
	return (value & 1) == 0;
}
org.casalib.util.NumberUtil.isOdd = function(value) {
	return !(value & 1) == 0;
}
org.casalib.util.NumberUtil.isInteger = function(value) {
	return (value % 1) == 0;
}
org.casalib.util.NumberUtil.isPrime = function(value) {
	if(value == 1 || value == 2) return true;
	if((value & 1) == 0) return false;
	var s = Math.sqrt(value);
	{
		var _g1 = 3, _g = Std["int"](s);
		while(_g1 < _g) {
			var i = _g1++;
			if(value % i == 0) return false;
		}
	}
	return true;
}
org.casalib.util.NumberUtil.roundDecimalToPlace = function(value,place) {
	var p = Math.pow(10,place);
	return Math.round(value * p) / p;
}
org.casalib.util.NumberUtil.loopIndex = function(index,length) {
	if(index < 0) index = length + index % length;
	if(index >= length) index %= length;
	return index;
}
org.casalib.util.NumberUtil.isBetween = function(value,firstValue,secondValue) {
	return !(value < Math.min(firstValue,secondValue) || value > Math.max(firstValue,secondValue));
}
org.casalib.util.NumberUtil.constrain = function(value,firstValue,secondValue) {
	return Math.min(Math.max(value,Math.min(firstValue,secondValue)),Math.max(firstValue,secondValue));
}
org.casalib.util.NumberUtil.createStepsBetween = function(begin,end,steps) {
	steps++;
	var i = 0;
	var stepsBetween = new Array();
	var increment = (end - begin) / steps;
	while(++i < steps) stepsBetween.push((i * increment) + begin);
	return stepsBetween;
}
org.casalib.util.NumberUtil.interpolate = function(amount,begin,end) {
	return begin + (end - begin) * amount._percent;
}
org.casalib.util.NumberUtil.normalize = function(value,minimum,maximum) {
	return new org.casalib.math.Percent((value - minimum) / (maximum - minimum));
}
org.casalib.util.NumberUtil.map = function(value,min1,max1,min2,max2) {
	return min2 + (max2 - min2) * ((value - min1) / (max1 - min1));
}
org.casalib.util.NumberUtil.getWeightedAverage = function(value,dest,n) {
	return value + (dest - value) / n;
}
org.casalib.util.NumberUtil.format = function(value,minLength,thouDelim,fillChar) {
	var num = Std.string(value);
	var len = num.length;
	if(thouDelim != null) {
		var numSplit = num.split("");
		var counter = 3;
		var i = numSplit.length;
		while(--i > 0) {
			counter--;
			if(counter == 0) {
				counter = 3;
				numSplit.insert(i,thouDelim);
			}
		}
		num = numSplit.join("");
	}
	if(minLength != 0) {
		if(len < minLength) {
			minLength -= len;
			var addChar = ((fillChar == null)?"0":fillChar);
			while(minLength-- > 0) num = addChar + num;
		}
	}
	return num;
}
org.casalib.util.NumberUtil.getOrdinalSuffix = function(value) {
	if(value >= 10 && value <= 20) return "th";
	if(value == 0) return "";
	switch(value % 10) {
	case 3:{
		return "rd";
	}break;
	case 2:{
		return "nd";
	}break;
	case 1:{
		return "st";
	}break;
	default:{
		return "th";
	}break;
	}
}
org.casalib.util.NumberUtil.addLeadingZero = function(value) {
	return ((value < 10)?"0" + value:Std.string(value));
}
org.casalib.util.NumberUtil.prototype.__class__ = org.casalib.util.NumberUtil;
StringBuf = function(p) { if( p === $_ ) return; {
	this.b = new Array();
}}
StringBuf.__name__ = ["StringBuf"];
StringBuf.prototype.add = function(x) {
	this.b[this.b.length] = x;
}
StringBuf.prototype.addChar = function(c) {
	this.b[this.b.length] = String.fromCharCode(c);
}
StringBuf.prototype.addSub = function(s,pos,len) {
	this.b[this.b.length] = s.substr(pos,len);
}
StringBuf.prototype.b = null;
StringBuf.prototype.toString = function() {
	return this.b.join("");
}
StringBuf.prototype.__class__ = StringBuf;
if(typeof haxe=='undefined') haxe = {}
if(!haxe.io) haxe.io = {}
haxe.io.Bytes = function(length,b) { if( length === $_ ) return; {
	this.length = length;
	this.b = b;
}}
haxe.io.Bytes.__name__ = ["haxe","io","Bytes"];
haxe.io.Bytes.alloc = function(length) {
	var a = new Array();
	{
		var _g = 0;
		while(_g < length) {
			var i = _g++;
			a.push(0);
		}
	}
	return new haxe.io.Bytes(length,a);
}
haxe.io.Bytes.ofString = function(s) {
	var a = new Array();
	{
		var _g1 = 0, _g = s.length;
		while(_g1 < _g) {
			var i = _g1++;
			var c = s["cca"](i);
			if(c <= 127) a.push(c);
			else if(c <= 2047) {
				a.push(192 | (c >> 6));
				a.push(128 | (c & 63));
			}
			else if(c <= 65535) {
				a.push(224 | (c >> 12));
				a.push(128 | ((c >> 6) & 63));
				a.push(128 | (c & 63));
			}
			else {
				a.push(240 | (c >> 18));
				a.push(128 | ((c >> 12) & 63));
				a.push(128 | ((c >> 6) & 63));
				a.push(128 | (c & 63));
			}
		}
	}
	return new haxe.io.Bytes(a.length,a);
}
haxe.io.Bytes.ofData = function(b) {
	return new haxe.io.Bytes(b.length,b);
}
haxe.io.Bytes.prototype.b = null;
haxe.io.Bytes.prototype.blit = function(pos,src,srcpos,len) {
	if(pos < 0 || srcpos < 0 || len < 0 || pos + len > this.length || srcpos + len > src.length) throw haxe.io.Error.OutsideBounds;
	var b1 = this.b;
	var b2 = src.b;
	if(b1 == b2 && pos > srcpos) {
		var i = len;
		while(i > 0) {
			i--;
			b1[i + pos] = b2[i + srcpos];
		}
		return;
	}
	{
		var _g = 0;
		while(_g < len) {
			var i = _g++;
			b1[i + pos] = b2[i + srcpos];
		}
	}
}
haxe.io.Bytes.prototype.compare = function(other) {
	var b1 = this.b;
	var b2 = other.b;
	var len = ((this.length < other.length)?this.length:other.length);
	{
		var _g = 0;
		while(_g < len) {
			var i = _g++;
			if(b1[i] != b2[i]) return b1[i] - b2[i];
		}
	}
	return this.length - other.length;
}
haxe.io.Bytes.prototype.get = function(pos) {
	return this.b[pos];
}
haxe.io.Bytes.prototype.getData = function() {
	return this.b;
}
haxe.io.Bytes.prototype.length = null;
haxe.io.Bytes.prototype.readString = function(pos,len) {
	if(pos < 0 || len < 0 || pos + len > this.length) throw haxe.io.Error.OutsideBounds;
	var s = "";
	var b = this.b;
	var fcc = $closure(String,"fromCharCode");
	var i = pos;
	var max = pos + len;
	while(i < max) {
		var c = b[i++];
		if(c < 128) {
			if(c == 0) break;
			s += fcc(c);
		}
		else if(c < 224) s += fcc(((c & 63) << 6) | (b[i++] & 127));
		else if(c < 240) {
			var c2 = b[i++];
			s += fcc((((c & 31) << 12) | ((c2 & 127) << 6)) | (b[i++] & 127));
		}
		else {
			var c2 = b[i++];
			var c3 = b[i++];
			s += fcc(((((c & 15) << 18) | ((c2 & 127) << 12)) | ((c3 << 6) & 127)) | (b[i++] & 127));
		}
	}
	return s;
}
haxe.io.Bytes.prototype.set = function(pos,v) {
	this.b[pos] = (v & 255);
}
haxe.io.Bytes.prototype.sub = function(pos,len) {
	if(pos < 0 || len < 0 || pos + len > this.length) throw haxe.io.Error.OutsideBounds;
	return new haxe.io.Bytes(len,this.b.slice(pos,pos + len));
}
haxe.io.Bytes.prototype.toString = function() {
	return this.readString(0,this.length);
}
haxe.io.Bytes.prototype.__class__ = haxe.io.Bytes;
if(!haxe._Template) haxe._Template = {}
haxe._Template.TemplateExpr = { __ename__ : ["haxe","_Template","TemplateExpr"], __constructs__ : ["OpVar","OpExpr","OpIf","OpStr","OpBlock","OpForeach","OpMacro"] }
haxe._Template.TemplateExpr.OpBlock = function(l) { var $x = ["OpBlock",4,l]; $x.__enum__ = haxe._Template.TemplateExpr; $x.toString = $estr; return $x; }
haxe._Template.TemplateExpr.OpExpr = function(expr) { var $x = ["OpExpr",1,expr]; $x.__enum__ = haxe._Template.TemplateExpr; $x.toString = $estr; return $x; }
haxe._Template.TemplateExpr.OpForeach = function(expr,loop) { var $x = ["OpForeach",5,expr,loop]; $x.__enum__ = haxe._Template.TemplateExpr; $x.toString = $estr; return $x; }
haxe._Template.TemplateExpr.OpIf = function(expr,eif,eelse) { var $x = ["OpIf",2,expr,eif,eelse]; $x.__enum__ = haxe._Template.TemplateExpr; $x.toString = $estr; return $x; }
haxe._Template.TemplateExpr.OpMacro = function(name,params) { var $x = ["OpMacro",6,name,params]; $x.__enum__ = haxe._Template.TemplateExpr; $x.toString = $estr; return $x; }
haxe._Template.TemplateExpr.OpStr = function(str) { var $x = ["OpStr",3,str]; $x.__enum__ = haxe._Template.TemplateExpr; $x.toString = $estr; return $x; }
haxe._Template.TemplateExpr.OpVar = function(v) { var $x = ["OpVar",0,v]; $x.__enum__ = haxe._Template.TemplateExpr; $x.toString = $estr; return $x; }
EReg = function(r,opt) { if( r === $_ ) return; {
	opt = opt.split("u").join("");
	this.r = new RegExp(r,opt);
}}
EReg.__name__ = ["EReg"];
EReg.prototype.customReplace = function(s,f) {
	var buf = new StringBuf();
	while(true) {
		if(!this.match(s)) break;
		buf.b[buf.b.length] = this.matchedLeft();
		buf.b[buf.b.length] = f(this);
		s = this.matchedRight();
	}
	buf.b[buf.b.length] = s;
	return buf.b.join("");
}
EReg.prototype.match = function(s) {
	this.r.m = this.r.exec(s);
	this.r.s = s;
	this.r.l = RegExp.leftContext;
	this.r.r = RegExp.rightContext;
	return (this.r.m != null);
}
EReg.prototype.matched = function(n) {
	return (this.r.m != null && n >= 0 && n < this.r.m.length?this.r.m[n]:(function($this) {
		var $r;
		throw "EReg::matched";
		return $r;
	}(this)));
}
EReg.prototype.matchedLeft = function() {
	if(this.r.m == null) throw "No string matched";
	if(this.r.l == null) return this.r.s.substr(0,this.r.m.index);
	return this.r.l;
}
EReg.prototype.matchedPos = function() {
	if(this.r.m == null) throw "No string matched";
	return { pos : this.r.m.index, len : this.r.m[0].length}
}
EReg.prototype.matchedRight = function() {
	if(this.r.m == null) throw "No string matched";
	if(this.r.r == null) {
		var sz = this.r.m.index + this.r.m[0].length;
		return this.r.s.substr(sz,this.r.s.length - sz);
	}
	return this.r.r;
}
EReg.prototype.r = null;
EReg.prototype.replace = function(s,by) {
	return s.replace(this.r,by);
}
EReg.prototype.split = function(s) {
	var d = "#__delim__#";
	return s.replace(this.r,d).split(d);
}
EReg.prototype.__class__ = EReg;
haxe.Template = function(str) { if( str === $_ ) return; {
	var tokens = this.parseTokens(str);
	this.expr = this.parseBlock(tokens);
	if(!tokens.isEmpty()) throw ("Unexpected '" + tokens.first().s) + "'";
}}
haxe.Template.__name__ = ["haxe","Template"];
haxe.Template.prototype.buf = null;
haxe.Template.prototype.context = null;
haxe.Template.prototype.execute = function(context,macros) {
	this.macros = (macros == null?{ }:macros);
	this.context = context;
	this.stack = new List();
	this.buf = new StringBuf();
	this.run(this.expr);
	return this.buf.b.join("");
}
haxe.Template.prototype.expr = null;
haxe.Template.prototype.macros = null;
haxe.Template.prototype.makeConst = function(v) {
	haxe.Template.expr_trim.match(v);
	v = haxe.Template.expr_trim.matched(1);
	if(v.charCodeAt(0) == 34) {
		var str = v.substr(1,v.length - 2);
		return function() {
			return str;
		}
	}
	if(haxe.Template.expr_int.match(v)) {
		var i = Std.parseInt(v);
		return function() {
			return i;
		}
	}
	if(haxe.Template.expr_float.match(v)) {
		var f = Std.parseFloat(v);
		return function() {
			return f;
		}
	}
	var me = this;
	return function() {
		return me.resolve(v);
	}
}
haxe.Template.prototype.makeExpr = function(l) {
	return this.makePath(this.makeExpr2(l),l);
}
haxe.Template.prototype.makeExpr2 = function(l) {
	var p = l.pop();
	if(p == null) throw "<eof>";
	if(p.s) return this.makeConst(p.p);
	switch(p.p) {
	case "(":{
		var e1 = this.makeExpr(l);
		var p1 = l.pop();
		if(p1 == null || p1.s) throw p1.p;
		if(p1.p == ")") return e1;
		var e2 = this.makeExpr(l);
		var p2 = l.pop();
		if(p2 == null || p2.p != ")") throw p2.p;
		return (function($this) {
			var $r;
			switch(p1.p) {
			case "+":{
				$r = function() {
					return e1() + e2();
				}
			}break;
			case "-":{
				$r = function() {
					return e1() - e2();
				}
			}break;
			case "*":{
				$r = function() {
					return e1() * e2();
				}
			}break;
			case "/":{
				$r = function() {
					return e1() / e2();
				}
			}break;
			case ">":{
				$r = function() {
					return e1() > e2();
				}
			}break;
			case "<":{
				$r = function() {
					return e1() < e2();
				}
			}break;
			case ">=":{
				$r = function() {
					return e1() >= e2();
				}
			}break;
			case "<=":{
				$r = function() {
					return e1() <= e2();
				}
			}break;
			case "==":{
				$r = function() {
					return e1() == e2();
				}
			}break;
			case "!=":{
				$r = function() {
					return e1() != e2();
				}
			}break;
			case "&&":{
				$r = function() {
					return e1() && e2();
				}
			}break;
			case "||":{
				$r = function() {
					return e1() || e2();
				}
			}break;
			default:{
				$r = (function($this) {
					var $r;
					throw "Unknown operation " + p1.p;
					return $r;
				}($this));
			}break;
			}
			return $r;
		}(this));
	}break;
	case "!":{
		var e = this.makeExpr(l);
		return function() {
			var v = e();
			return (v == null || v == false);
		}
	}break;
	case "-":{
		var e = this.makeExpr(l);
		return function() {
			return -e();
		}
	}break;
	}
	throw p.p;
}
haxe.Template.prototype.makePath = function(e,l) {
	var p = l.first();
	if(p == null || p.p != ".") return e;
	l.pop();
	var field = l.pop();
	if(field == null || !field.s) throw field.p;
	var f = field.p;
	haxe.Template.expr_trim.match(f);
	f = haxe.Template.expr_trim.matched(1);
	return this.makePath(function() {
		return Reflect.field(e(),f);
	},l);
}
haxe.Template.prototype.parse = function(tokens) {
	var t = tokens.pop();
	var p = t.p;
	if(t.s) return haxe._Template.TemplateExpr.OpStr(p);
	if(t.l != null) {
		var pe = new List();
		{
			var _g = 0, _g1 = t.l;
			while(_g < _g1.length) {
				var p1 = _g1[_g];
				++_g;
				pe.add(this.parseBlock(this.parseTokens(p1)));
			}
		}
		return haxe._Template.TemplateExpr.OpMacro(p,pe);
	}
	if(p.substr(0,3) == "if ") {
		p = p.substr(3,p.length - 3);
		var e = this.parseExpr(p);
		var eif = this.parseBlock(tokens);
		var t1 = tokens.first();
		var eelse;
		if(t1 == null) throw "Unclosed 'if'";
		if(t1.p == "end") {
			tokens.pop();
			eelse = null;
		}
		else if(t1.p == "else") {
			tokens.pop();
			eelse = this.parseBlock(tokens);
			t1 = tokens.pop();
			if(t1 == null || t1.p != "end") throw "Unclosed 'else'";
		}
		else {
			t1.p = t1.p.substr(4,t1.p.length - 4);
			eelse = this.parse(tokens);
		}
		return haxe._Template.TemplateExpr.OpIf(e,eif,eelse);
	}
	if(p.substr(0,8) == "foreach ") {
		p = p.substr(8,p.length - 8);
		var e = this.parseExpr(p);
		var efor = this.parseBlock(tokens);
		var t1 = tokens.pop();
		if(t1 == null || t1.p != "end") throw "Unclosed 'foreach'";
		return haxe._Template.TemplateExpr.OpForeach(e,efor);
	}
	if(haxe.Template.expr_splitter.match(p)) return haxe._Template.TemplateExpr.OpExpr(this.parseExpr(p));
	return haxe._Template.TemplateExpr.OpVar(p);
}
haxe.Template.prototype.parseBlock = function(tokens) {
	var l = new List();
	while(true) {
		var t = tokens.first();
		if(t == null) break;
		if(!t.s && (t.p == "end" || t.p == "else" || t.p.substr(0,7) == "elseif ")) break;
		l.add(this.parse(tokens));
	}
	if(l.length == 1) return l.first();
	return haxe._Template.TemplateExpr.OpBlock(l);
}
haxe.Template.prototype.parseExpr = function(data) {
	var l = new List();
	var expr = data;
	while(haxe.Template.expr_splitter.match(data)) {
		var p = haxe.Template.expr_splitter.matchedPos();
		var k = p.pos + p.len;
		if(p.pos != 0) l.add({ p : data.substr(0,p.pos), s : true});
		var p1 = haxe.Template.expr_splitter.matched(0);
		l.add({ p : p1, s : p1.indexOf("\"") >= 0});
		data = haxe.Template.expr_splitter.matchedRight();
	}
	if(data.length != 0) l.add({ p : data, s : true});
	var e;
	try {
		e = this.makeExpr(l);
		if(!l.isEmpty()) throw l.first().p;
	}
	catch( $e0 ) {
		if( js.Boot.__instanceof($e0,String) ) {
			var s = $e0;
			{
				throw (("Unexpected '" + s) + "' in ") + expr;
			}
		} else throw($e0);
	}
	return function() {
		try {
			return e();
		}
		catch( $e1 ) {
			{
				var exc = $e1;
				{
					throw (("Error : " + Std.string(exc)) + " in ") + expr;
				}
			}
		}
	}
}
haxe.Template.prototype.parseTokens = function(data) {
	var tokens = new List();
	while(haxe.Template.splitter.match(data)) {
		var p = haxe.Template.splitter.matchedPos();
		if(p.pos > 0) tokens.add({ p : data.substr(0,p.pos), s : true, l : null});
		if(data.charCodeAt(p.pos) == 58) {
			tokens.add({ p : data.substr(p.pos + 2,p.len - 4), s : false, l : null});
			data = haxe.Template.splitter.matchedRight();
			continue;
		}
		var parp = p.pos + p.len;
		var npar = 1;
		while(npar > 0) {
			var c = data.charCodeAt(parp);
			if(c == 40) npar++;
			else if(c == 41) npar--;
			else if(c == null) throw "Unclosed macro parenthesis";
			parp++;
		}
		var params = data.substr(p.pos + p.len,(parp - (p.pos + p.len)) - 1).split(",");
		tokens.add({ p : haxe.Template.splitter.matched(2), s : false, l : params});
		data = data.substr(parp,data.length - parp);
	}
	if(data.length > 0) tokens.add({ p : data, s : true, l : null});
	return tokens;
}
haxe.Template.prototype.resolve = function(v) {
	if(Reflect.hasField(this.context,v)) return Reflect.field(this.context,v);
	{ var $it0 = this.stack.iterator();
	while( $it0.hasNext() ) { var ctx = $it0.next();
	if(Reflect.hasField(ctx,v)) return Reflect.field(ctx,v);
	}}
	if(v == "__current__") return this.context;
	return Reflect.field(haxe.Template.globals,v);
}
haxe.Template.prototype.run = function(e) {
	var $e = (e);
	switch( $e[1] ) {
	case 0:
	var v = $e[2];
	{
		this.buf.add(Std.string(this.resolve(v)));
	}break;
	case 1:
	var e1 = $e[2];
	{
		this.buf.add(Std.string(e1()));
	}break;
	case 2:
	var eelse = $e[4], eif = $e[3], e1 = $e[2];
	{
		var v = e1();
		if(v == null || v == false) {
			if(eelse != null) this.run(eelse);
		}
		else this.run(eif);
	}break;
	case 3:
	var str = $e[2];
	{
		this.buf.add(str);
	}break;
	case 4:
	var l = $e[2];
	{
		{ var $it0 = l.iterator();
		while( $it0.hasNext() ) { var e1 = $it0.next();
		this.run(e1);
		}}
	}break;
	case 5:
	var loop = $e[3], e1 = $e[2];
	{
		var v = e1();
		try {
			if(v.hasNext == null) {
				var x = v.iterator();
				if(x.hasNext == null) throw null;
				v = x;
			}
		}
		catch( $e1 ) {
			{
				var e2 = $e1;
				{
					throw "Cannot iter on " + v;
				}
			}
		}
		this.stack.push(this.context);
		var v1 = v;
		{ var $it2 = v1;
		while( $it2.hasNext() ) { var ctx = $it2.next();
		{
			this.context = ctx;
			this.run(loop);
		}
		}}
		this.context = this.stack.pop();
	}break;
	case 6:
	var params = $e[3], m = $e[2];
	{
		var v = Reflect.field(this.macros,m);
		var pl = new Array();
		var old = this.buf;
		pl.push($closure(this,"resolve"));
		{ var $it3 = params.iterator();
		while( $it3.hasNext() ) { var p = $it3.next();
		{
			var $e = (p);
			switch( $e[1] ) {
			case 0:
			var v1 = $e[2];
			{
				pl.push(this.resolve(v1));
			}break;
			default:{
				this.buf = new StringBuf();
				this.run(p);
				pl.push(this.buf.b.join(""));
			}break;
			}
		}
		}}
		this.buf = old;
		try {
			this.buf.add(Std.string(v.apply(this.macros,pl)));
		}
		catch( $e4 ) {
			{
				var e1 = $e4;
				{
					var plstr = (function($this) {
						var $r;
						try {
							$r = pl.join(",");
						}
						catch( $e5 ) {
							{
								var e2 = $e5;
								$r = "???";
							}
						}
						return $r;
					}(this));
					var msg = ((((("Macro call " + m) + "(") + plstr) + ") failed (") + Std.string(e1)) + ")";
					throw msg;
				}
			}
		}
	}break;
	}
}
haxe.Template.prototype.stack = null;
haxe.Template.prototype.__class__ = haxe.Template;
IntIter = function(min,max) { if( min === $_ ) return; {
	this.min = min;
	this.max = max;
}}
IntIter.__name__ = ["IntIter"];
IntIter.prototype.hasNext = function() {
	return this.min < this.max;
}
IntIter.prototype.max = null;
IntIter.prototype.min = null;
IntIter.prototype.next = function() {
	return this.min++;
}
IntIter.prototype.__class__ = IntIter;
haxe.Timer = function(time_ms) { if( time_ms === $_ ) return; {
	this.id = haxe.Timer.arr.length;
	haxe.Timer.arr[this.id] = this;
	this.timerId = window.setInterval(("haxe.Timer.arr[" + this.id) + "].run();",time_ms);
}}
haxe.Timer.__name__ = ["haxe","Timer"];
haxe.Timer.delay = function(f,time_ms) {
	var t = new haxe.Timer(time_ms);
	t.run = function() {
		t.stop();
		f();
	}
	return t;
}
haxe.Timer.stamp = function() {
	return Date.now().getTime() / 1000;
}
haxe.Timer.prototype.id = null;
haxe.Timer.prototype.run = function() {
	null;
}
haxe.Timer.prototype.stop = function() {
	if(this.id == null) return;
	window.clearInterval(this.timerId);
	haxe.Timer.arr[this.id] = null;
	if(this.id > 100 && this.id == haxe.Timer.arr.length - 1) {
		var p = this.id - 1;
		while(p >= 0 && haxe.Timer.arr[p] == null) p--;
		haxe.Timer.arr = haxe.Timer.arr.slice(0,p + 1);
	}
	this.id = null;
}
haxe.Timer.prototype.timerId = null;
haxe.Timer.prototype.__class__ = haxe.Timer;
haxe.io.Error = { __ename__ : ["haxe","io","Error"], __constructs__ : ["Blocked","Overflow","OutsideBounds","Custom"] }
haxe.io.Error.Blocked = ["Blocked",0];
haxe.io.Error.Blocked.toString = $estr;
haxe.io.Error.Blocked.__enum__ = haxe.io.Error;
haxe.io.Error.Custom = function(e) { var $x = ["Custom",3,e]; $x.__enum__ = haxe.io.Error; $x.toString = $estr; return $x; }
haxe.io.Error.OutsideBounds = ["OutsideBounds",2];
haxe.io.Error.OutsideBounds.toString = $estr;
haxe.io.Error.OutsideBounds.__enum__ = haxe.io.Error;
haxe.io.Error.Overflow = ["Overflow",1];
haxe.io.Error.Overflow.toString = $estr;
haxe.io.Error.Overflow.__enum__ = haxe.io.Error;
Type = function() { }
Type.__name__ = ["Type"];
Type.getClass = function(o) {
	if(o == null) return null;
	if(o.__enum__ != null) return null;
	return o.__class__;
}
Type.getEnum = function(o) {
	if(o == null) return null;
	return o.__enum__;
}
Type.getSuperClass = function(c) {
	return c.__super__;
}
Type.getClassName = function(c) {
	var a = c.__name__;
	return a.join(".");
}
Type.getEnumName = function(e) {
	var a = e.__ename__;
	return a.join(".");
}
Type.resolveClass = function(name) {
	var cl;
	try {
		cl = eval(name);
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				cl = null;
			}
		}
	}
	if(cl == null || cl.__name__ == null) return null;
	return cl;
}
Type.resolveEnum = function(name) {
	var e;
	try {
		e = eval(name);
	}
	catch( $e0 ) {
		{
			var err = $e0;
			{
				e = null;
			}
		}
	}
	if(e == null || e.__ename__ == null) return null;
	return e;
}
Type.createInstance = function(cl,args) {
	if(args.length <= 3) return new cl(args[0],args[1],args[2]);
	if(args.length > 8) throw "Too many arguments";
	return new cl(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7]);
}
Type.createEmptyInstance = function(cl) {
	return new cl($_);
}
Type.createEnum = function(e,constr,params) {
	var f = Reflect.field(e,constr);
	if(f == null) throw "No such constructor " + constr;
	if(Reflect.isFunction(f)) {
		if(params == null) throw ("Constructor " + constr) + " need parameters";
		return f.apply(e,params);
	}
	if(params != null && params.length != 0) throw ("Constructor " + constr) + " does not need parameters";
	return f;
}
Type.createEnumIndex = function(e,index,params) {
	var c = Type.getEnumConstructs(e)[index];
	if(c == null) throw index + " is not a valid enum constructor index";
	return Type.createEnum(e,c,params);
}
Type.getInstanceFields = function(c) {
	var a = Reflect.fields(c.prototype);
	a.remove("__class__");
	return a;
}
Type.getClassFields = function(c) {
	var a = Reflect.fields(c);
	a.remove("__name__");
	a.remove("__interfaces__");
	a.remove("__super__");
	a.remove("prototype");
	return a;
}
Type.getEnumConstructs = function(e) {
	return e.__constructs__;
}
Type["typeof"] = function(v) {
	switch(typeof(v)) {
	case "boolean":{
		return ValueType.TBool;
	}break;
	case "string":{
		return ValueType.TClass(String);
	}break;
	case "number":{
		if(Math.ceil(v) == v % 2147483648.0) return ValueType.TInt;
		return ValueType.TFloat;
	}break;
	case "object":{
		if(v == null) return ValueType.TNull;
		var e = v.__enum__;
		if(e != null) return ValueType.TEnum(e);
		var c = v.__class__;
		if(c != null) return ValueType.TClass(c);
		return ValueType.TObject;
	}break;
	case "function":{
		if(v.__name__ != null) return ValueType.TObject;
		return ValueType.TFunction;
	}break;
	case "undefined":{
		return ValueType.TNull;
	}break;
	default:{
		return ValueType.TUnknown;
	}break;
	}
}
Type.enumEq = function(a,b) {
	if(a == b) return true;
	try {
		if(a[0] != b[0]) return false;
		{
			var _g1 = 2, _g = a.length;
			while(_g1 < _g) {
				var i = _g1++;
				if(!Type.enumEq(a[i],b[i])) return false;
			}
		}
		var e = a.__enum__;
		if(e != b.__enum__ || e == null) return false;
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				return false;
			}
		}
	}
	return true;
}
Type.enumConstructor = function(e) {
	return e[0];
}
Type.enumParameters = function(e) {
	return e.slice(2);
}
Type.enumIndex = function(e) {
	return e[1];
}
Type.prototype.__class__ = Type;
haxe.Unserializer = function(buf) { if( buf === $_ ) return; {
	this.buf = buf;
	this.length = buf.length;
	this.pos = 0;
	this.scache = new Array();
	this.cache = new Array();
	this.setResolver(haxe.Unserializer.DEFAULT_RESOLVER);
}}
haxe.Unserializer.__name__ = ["haxe","Unserializer"];
haxe.Unserializer.initCodes = function() {
	var codes = new Array();
	{
		var _g1 = 0, _g = haxe.Unserializer.BASE64.length;
		while(_g1 < _g) {
			var i = _g1++;
			codes[haxe.Unserializer.BASE64.cca(i)] = i;
		}
	}
	return codes;
}
haxe.Unserializer.run = function(v) {
	return new haxe.Unserializer(v).unserialize();
}
haxe.Unserializer.prototype.buf = null;
haxe.Unserializer.prototype.cache = null;
haxe.Unserializer.prototype.get = function(p) {
	return this.buf.cca(p);
}
haxe.Unserializer.prototype.getResolver = function() {
	return this.resolver;
}
haxe.Unserializer.prototype.length = null;
haxe.Unserializer.prototype.pos = null;
haxe.Unserializer.prototype.readDigits = function() {
	var k = 0;
	var s = false;
	var fpos = this.pos;
	while(true) {
		var c = this.buf.cca(this.pos);
		if(Math.isNaN(c)) break;
		if(c == 45) {
			if(this.pos != fpos) break;
			s = true;
			this.pos++;
			continue;
		}
		if(c < 48 || c > 57) break;
		k = k * 10 + (c - 48);
		this.pos++;
	}
	if(s) k *= -1;
	return k;
}
haxe.Unserializer.prototype.resolver = null;
haxe.Unserializer.prototype.scache = null;
haxe.Unserializer.prototype.setResolver = function(r) {
	if(r == null) this.resolver = { resolveClass : function(_) {
		return null;
	}, resolveEnum : function(_) {
		return null;
	}}
	else this.resolver = r;
}
haxe.Unserializer.prototype.unserialize = function() {
	switch(this.buf.cca(this.pos++)) {
	case 110:{
		return null;
	}break;
	case 116:{
		return true;
	}break;
	case 102:{
		return false;
	}break;
	case 122:{
		return 0;
	}break;
	case 105:{
		return this.readDigits();
	}break;
	case 100:{
		var p1 = this.pos;
		while(true) {
			var c = this.buf.cca(this.pos);
			if((c >= 43 && c < 58) || c == 101 || c == 69) this.pos++;
			else break;
		}
		return Std.parseFloat(this.buf.substr(p1,this.pos - p1));
	}break;
	case 121:{
		var len = this.readDigits();
		if(this.buf.cca(this.pos++) != 58 || this.length - this.pos < len) throw "Invalid string length";
		var s = this.buf.substr(this.pos,len);
		this.pos += len;
		s = StringTools.urlDecode(s);
		this.scache.push(s);
		return s;
	}break;
	case 107:{
		return Math.NaN;
	}break;
	case 109:{
		return Math.NEGATIVE_INFINITY;
	}break;
	case 112:{
		return Math.POSITIVE_INFINITY;
	}break;
	case 97:{
		var buf = this.buf;
		var a = new Array();
		this.cache.push(a);
		while(true) {
			var c = this.buf.cca(this.pos);
			if(c == 104) {
				this.pos++;
				break;
			}
			if(c == 117) {
				this.pos++;
				var n = this.readDigits();
				a[(a.length + n) - 1] = null;
			}
			else a.push(this.unserialize());
		}
		return a;
	}break;
	case 111:{
		var o = { }
		this.cache.push(o);
		this.unserializeObject(o);
		return o;
	}break;
	case 114:{
		var n = this.readDigits();
		if(n < 0 || n >= this.cache.length) throw "Invalid reference";
		return this.cache[n];
	}break;
	case 82:{
		var n = this.readDigits();
		if(n < 0 || n >= this.scache.length) throw "Invalid string reference";
		return this.scache[n];
	}break;
	case 120:{
		throw this.unserialize();
	}break;
	case 99:{
		var name = this.unserialize();
		var cl = this.resolver.resolveClass(name);
		if(cl == null) throw "Class not found " + name;
		var o = Type.createEmptyInstance(cl);
		this.cache.push(o);
		this.unserializeObject(o);
		return o;
	}break;
	case 119:{
		var name = this.unserialize();
		var edecl = this.resolver.resolveEnum(name);
		if(edecl == null) throw "Enum not found " + name;
		return this.unserializeEnum(edecl,this.unserialize());
	}break;
	case 106:{
		var name = this.unserialize();
		var edecl = this.resolver.resolveEnum(name);
		if(edecl == null) throw "Enum not found " + name;
		this.pos++;
		var index = this.readDigits();
		var tag = Type.getEnumConstructs(edecl)[index];
		if(tag == null) throw (("Unknown enum index " + name) + "@") + index;
		return this.unserializeEnum(edecl,tag);
	}break;
	case 108:{
		var l = new List();
		this.cache.push(l);
		var buf = this.buf;
		while(this.buf.cca(this.pos) != 104) l.add(this.unserialize());
		this.pos++;
		return l;
	}break;
	case 98:{
		var h = new Hash();
		this.cache.push(h);
		var buf = this.buf;
		while(this.buf.cca(this.pos) != 104) {
			var s = this.unserialize();
			h.set(s,this.unserialize());
		}
		this.pos++;
		return h;
	}break;
	case 113:{
		var h = new IntHash();
		this.cache.push(h);
		var buf = this.buf;
		var c = this.buf.cca(this.pos++);
		while(c == 58) {
			var i = this.readDigits();
			h.set(i,this.unserialize());
			c = this.buf.cca(this.pos++);
		}
		if(c != 104) throw "Invalid IntHash format";
		return h;
	}break;
	case 118:{
		var d = Date.fromString(this.buf.substr(this.pos,19));
		this.cache.push(d);
		this.pos += 19;
		return d;
	}break;
	case 115:{
		var len = this.readDigits();
		var buf = this.buf;
		if(this.buf.cca(this.pos++) != 58 || this.length - this.pos < len) throw "Invalid bytes length";
		var codes = haxe.Unserializer.CODES;
		if(codes == null) {
			codes = haxe.Unserializer.initCodes();
			haxe.Unserializer.CODES = codes;
		}
		var i = this.pos;
		var rest = len & 3;
		var size = (len >> 2) * 3 + (((rest >= 2)?rest - 1:0));
		var max = i + (len - rest);
		var bytes = haxe.io.Bytes.alloc(size);
		var bpos = 0;
		while(i < max) {
			var c1 = codes[buf.cca(i++)];
			var c2 = codes[buf.cca(i++)];
			bytes.b[bpos++] = (((c1 << 2) | (c2 >> 4)) & 255);
			var c3 = codes[buf.cca(i++)];
			bytes.b[bpos++] = (((c2 << 4) | (c3 >> 2)) & 255);
			var c4 = codes[buf.cca(i++)];
			bytes.b[bpos++] = (((c3 << 6) | c4) & 255);
		}
		if(rest >= 2) {
			var c1 = codes[buf.cca(i++)];
			var c2 = codes[buf.cca(i++)];
			bytes.b[bpos++] = (((c1 << 2) | (c2 >> 4)) & 255);
			if(rest == 3) {
				var c3 = codes[buf.cca(i++)];
				bytes.b[bpos++] = (((c2 << 4) | (c3 >> 2)) & 255);
			}
		}
		this.pos += len;
		this.cache.push(bytes);
		return bytes;
	}break;
	case 67:{
		var name = this.unserialize();
		var cl = this.resolver.resolveClass(name);
		if(cl == null) throw "Class not found " + name;
		var o = Type.createEmptyInstance(cl);
		this.cache.push(o);
		o.hxUnserialize(this);
		if(this.buf.cca(this.pos++) != 103) throw "Invalid custom data";
		return o;
	}break;
	default:{
		null;
	}break;
	}
	this.pos--;
	throw ((("Invalid char " + this.buf.charAt(this.pos)) + " at position ") + this.pos);
}
haxe.Unserializer.prototype.unserializeEnum = function(edecl,tag) {
	var constr = Reflect.field(edecl,tag);
	if(constr == null) throw (("Unknown enum tag " + Type.getEnumName(edecl)) + ".") + tag;
	if(this.buf.cca(this.pos++) != 58) throw "Invalid enum format";
	var nargs = this.readDigits();
	if(nargs == 0) {
		this.cache.push(constr);
		return constr;
	}
	var args = new Array();
	while(nargs > 0) {
		args.push(this.unserialize());
		nargs -= 1;
	}
	var e = constr.apply(edecl,args);
	this.cache.push(e);
	return e;
}
haxe.Unserializer.prototype.unserializeObject = function(o) {
	while(true) {
		if(this.pos >= this.length) throw "Invalid object";
		if(this.buf.cca(this.pos) == 103) break;
		var k = this.unserialize();
		if(!Std["is"](k,String)) throw "Invalid object key";
		var v = this.unserialize();
		o[k] = v;
	}
	this.pos++;
}
haxe.Unserializer.prototype.__class__ = haxe.Unserializer;
org.casalib.util.ObjectUtil = function() { }
org.casalib.util.ObjectUtil.__name__ = ["org","casalib","util","ObjectUtil"];
org.casalib.util.ObjectUtil.contains = function(obj,member) {
	{
		var _g = 0, _g1 = org.casalib.util.ObjectUtil.getKeys(obj);
		while(_g < _g1.length) {
			var prop = _g1[_g];
			++_g;
			var val = Reflect.field(obj,prop);
			if(val != null && val == member) {
				return true;
			}
		}
	}
	return false;
}
org.casalib.util.ObjectUtil.clone = function(obj) {
	return haxe.Unserializer.run(haxe.Serializer.run(obj));
}
org.casalib.util.ObjectUtil.getKeys = function(obj) {
	return Reflect.fields(obj);
}
org.casalib.util.ObjectUtil.isUndefined = function(obj) {
	return obj == null;
}
org.casalib.util.ObjectUtil.isNull = function(obj) {
	return obj == null;
}
org.casalib.util.ObjectUtil.isEmpty = function(obj) {
	if(obj == null) return true;
	if(Std["is"](obj,Float) || Std["is"](obj,Int)) return Math.isNaN(obj);
	if(Std["is"](obj,Array) || Std["is"](obj,String)) return obj.length == 0;
	return org.casalib.util.ObjectUtil.getKeys(obj).length == 0;
}
org.casalib.util.ObjectUtil.prototype.__class__ = org.casalib.util.ObjectUtil;
Std = function() { }
Std.__name__ = ["Std"];
Std["is"] = function(v,t) {
	return js.Boot.__instanceof(v,t);
}
Std.string = function(s) {
	return js.Boot.__string_rec(s,"");
}
Std["int"] = function(x) {
	if(x < 0) return Math.ceil(x);
	return Math.floor(x);
}
Std.parseInt = function(x) {
	var v = parseInt(x);
	if(Math.isNaN(v)) return null;
	return v;
}
Std.parseFloat = function(x) {
	return parseFloat(x);
}
Std.random = function(x) {
	return Math.floor(Math.random() * x);
}
Std.prototype.__class__ = Std;
if(!org.casalib.math) org.casalib.math = {}
org.casalib.math.Percent = function(percentage,isDecimalPercentage) { if( percentage === $_ ) return; {
	if(isDecimalPercentage == null) isDecimalPercentage = true;
	if(percentage == null) percentage = 0;
	if(isDecimalPercentage) {
		{
			this._percent = percentage;
			percentage;
		}
	}
	else {
		{
			this._percent = percentage * .01;
			percentage;
		}
	}
}}
org.casalib.math.Percent.__name__ = ["org","casalib","math","Percent"];
org.casalib.math.Percent.prototype._percent = null;
org.casalib.math.Percent.prototype.clone = function() {
	return new org.casalib.math.Percent(this._percent);
}
org.casalib.math.Percent.prototype.decimalPercentage = null;
org.casalib.math.Percent.prototype.equals = function(percent) {
	return this._percent == percent._percent;
}
org.casalib.math.Percent.prototype.getDecimalPercentage = function() {
	return this._percent;
}
org.casalib.math.Percent.prototype.getPercentage = function() {
	return 100 * this._percent;
}
org.casalib.math.Percent.prototype.percentage = null;
org.casalib.math.Percent.prototype.setDecimalPercentage = function(percent) {
	this._percent = percent;
	return percent;
}
org.casalib.math.Percent.prototype.setPercentage = function(percent) {
	this._percent = percent * .01;
	return percent;
}
org.casalib.math.Percent.prototype.toString = function() {
	return Std.string(this._percent);
}
org.casalib.math.Percent.prototype.valueOf = function() {
	return this._percent;
}
org.casalib.math.Percent.prototype.__class__ = org.casalib.math.Percent;
Lambda = function() { }
Lambda.__name__ = ["Lambda"];
Lambda.array = function(it) {
	var a = new Array();
	{ var $it0 = it.iterator();
	while( $it0.hasNext() ) { var i = $it0.next();
	a.push(i);
	}}
	return a;
}
Lambda.list = function(it) {
	var l = new List();
	{ var $it0 = it.iterator();
	while( $it0.hasNext() ) { var i = $it0.next();
	l.add(i);
	}}
	return l;
}
Lambda.map = function(it,f) {
	var l = new List();
	{ var $it0 = it.iterator();
	while( $it0.hasNext() ) { var x = $it0.next();
	l.add(f(x));
	}}
	return l;
}
Lambda.mapi = function(it,f) {
	var l = new List();
	var i = 0;
	{ var $it0 = it.iterator();
	while( $it0.hasNext() ) { var x = $it0.next();
	l.add(f(i++,x));
	}}
	return l;
}
Lambda.has = function(it,elt,cmp) {
	if(cmp == null) {
		{ var $it0 = it.iterator();
		while( $it0.hasNext() ) { var x = $it0.next();
		if(x == elt) return true;
		}}
	}
	else {
		{ var $it1 = it.iterator();
		while( $it1.hasNext() ) { var x = $it1.next();
		if(cmp(x,elt)) return true;
		}}
	}
	return false;
}
Lambda.exists = function(it,f) {
	{ var $it0 = it.iterator();
	while( $it0.hasNext() ) { var x = $it0.next();
	if(f(x)) return true;
	}}
	return false;
}
Lambda.foreach = function(it,f) {
	{ var $it0 = it.iterator();
	while( $it0.hasNext() ) { var x = $it0.next();
	if(!f(x)) return false;
	}}
	return true;
}
Lambda.iter = function(it,f) {
	{ var $it0 = it.iterator();
	while( $it0.hasNext() ) { var x = $it0.next();
	f(x);
	}}
}
Lambda.filter = function(it,f) {
	var l = new List();
	{ var $it0 = it.iterator();
	while( $it0.hasNext() ) { var x = $it0.next();
	if(f(x)) l.add(x);
	}}
	return l;
}
Lambda.fold = function(it,f,first) {
	{ var $it0 = it.iterator();
	while( $it0.hasNext() ) { var x = $it0.next();
	first = f(x,first);
	}}
	return first;
}
Lambda.count = function(it) {
	var n = 0;
	{ var $it0 = it.iterator();
	while( $it0.hasNext() ) { var _ = $it0.next();
	++n;
	}}
	return n;
}
Lambda.empty = function(it) {
	return !it.iterator().hasNext();
}
Lambda.prototype.__class__ = Lambda;
haxe.Serializer = function(p) { if( p === $_ ) return; {
	this.buf = new StringBuf();
	this.cache = new Array();
	this.useCache = haxe.Serializer.USE_CACHE;
	this.useEnumIndex = haxe.Serializer.USE_ENUM_INDEX;
	this.shash = new Hash();
	this.scount = 0;
}}
haxe.Serializer.__name__ = ["haxe","Serializer"];
haxe.Serializer.run = function(v) {
	var s = new haxe.Serializer();
	s.serialize(v);
	return s.toString();
}
haxe.Serializer.prototype.buf = null;
haxe.Serializer.prototype.cache = null;
haxe.Serializer.prototype.scount = null;
haxe.Serializer.prototype.serialize = function(v) {
	var $e = (Type["typeof"](v));
	switch( $e[1] ) {
	case 0:
	{
		this.buf.add("n");
	}break;
	case 1:
	{
		if(v == 0) {
			this.buf.add("z");
			return;
		}
		this.buf.add("i");
		this.buf.add(v);
	}break;
	case 2:
	{
		if(Math.isNaN(v)) this.buf.add("k");
		else if(!Math.isFinite(v)) this.buf.add((v < 0?"m":"p"));
		else {
			this.buf.add("d");
			this.buf.add(v);
		}
	}break;
	case 3:
	{
		this.buf.add((v?"t":"f"));
	}break;
	case 6:
	var c = $e[2];
	{
		if(c == String) {
			this.serializeString(v);
			return;
		}
		if(this.useCache && this.serializeRef(v)) return;
		switch(c) {
		case Array:{
			var ucount = 0;
			this.buf.add("a");
			var l = v["length"];
			{
				var _g = 0;
				while(_g < l) {
					var i = _g++;
					if(v[i] == null) ucount++;
					else {
						if(ucount > 0) {
							if(ucount == 1) this.buf.add("n");
							else {
								this.buf.add("u");
								this.buf.add(ucount);
							}
							ucount = 0;
						}
						this.serialize(v[i]);
					}
				}
			}
			if(ucount > 0) {
				if(ucount == 1) this.buf.add("n");
				else {
					this.buf.add("u");
					this.buf.add(ucount);
				}
			}
			this.buf.add("h");
		}break;
		case List:{
			this.buf.add("l");
			var v1 = v;
			{ var $it0 = v1.iterator();
			while( $it0.hasNext() ) { var i = $it0.next();
			this.serialize(i);
			}}
			this.buf.add("h");
		}break;
		case Date:{
			var d = v;
			this.buf.add("v");
			this.buf.add(d.toString());
		}break;
		case Hash:{
			this.buf.add("b");
			var v1 = v;
			{ var $it1 = v1.keys();
			while( $it1.hasNext() ) { var k = $it1.next();
			{
				this.serializeString(k);
				this.serialize(v1.get(k));
			}
			}}
			this.buf.add("h");
		}break;
		case IntHash:{
			this.buf.add("q");
			var v1 = v;
			{ var $it2 = v1.keys();
			while( $it2.hasNext() ) { var k = $it2.next();
			{
				this.buf.add(":");
				this.buf.add(k);
				this.serialize(v1.get(k));
			}
			}}
			this.buf.add("h");
		}break;
		case haxe.io.Bytes:{
			var v1 = v;
			var i = 0;
			var max = v1.length - 2;
			var chars = "";
			var b64 = haxe.Serializer.BASE64;
			while(i < max) {
				var b1 = v1.b[i++];
				var b2 = v1.b[i++];
				var b3 = v1.b[i++];
				chars += ((b64.charAt(b1 >> 2) + b64.charAt(((b1 << 4) | (b2 >> 4)) & 63)) + b64.charAt(((b2 << 2) | (b3 >> 6)) & 63)) + b64.charAt(b3 & 63);
			}
			if(i == max) {
				var b1 = v1.b[i++];
				var b2 = v1.b[i++];
				chars += (b64.charAt(b1 >> 2) + b64.charAt(((b1 << 4) | (b2 >> 4)) & 63)) + b64.charAt((b2 << 2) & 63);
			}
			else if(i == max + 1) {
				var b1 = v1.b[i++];
				chars += b64.charAt(b1 >> 2) + b64.charAt((b1 << 4) & 63);
			}
			this.buf.add("s");
			this.buf.add(chars.length);
			this.buf.add(":");
			this.buf.add(chars);
		}break;
		default:{
			this.cache.pop();
			if(v.hxSerialize != null) {
				this.buf.add("C");
				this.serializeString(Type.getClassName(c));
				this.cache.push(v);
				v.hxSerialize(this);
				this.buf.add("g");
			}
			else {
				this.buf.add("c");
				this.serializeString(Type.getClassName(c));
				this.cache.push(v);
				this.serializeFields(v);
			}
		}break;
		}
	}break;
	case 4:
	{
		if(this.useCache && this.serializeRef(v)) return;
		this.buf.add("o");
		this.serializeFields(v);
	}break;
	case 7:
	var e = $e[2];
	{
		if(this.useCache && this.serializeRef(v)) return;
		this.cache.pop();
		this.buf.add((this.useEnumIndex?"j":"w"));
		this.serializeString(Type.getEnumName(e));
		if(this.useEnumIndex) {
			this.buf.add(":");
			this.buf.add(v[1]);
		}
		else this.serializeString(v[0]);
		this.buf.add(":");
		var l = v["length"];
		this.buf.add(l - 2);
		{
			var _g = 2;
			while(_g < l) {
				var i = _g++;
				this.serialize(v[i]);
			}
		}
		this.cache.push(v);
	}break;
	case 5:
	{
		throw "Cannot serialize function";
	}break;
	default:{
		throw "Cannot serialize " + Std.string(v);
	}break;
	}
}
haxe.Serializer.prototype.serializeException = function(e) {
	this.buf.add("x");
	this.serialize(e);
}
haxe.Serializer.prototype.serializeFields = function(v) {
	{
		var _g = 0, _g1 = Reflect.fields(v);
		while(_g < _g1.length) {
			var f = _g1[_g];
			++_g;
			this.serializeString(f);
			this.serialize(Reflect.field(v,f));
		}
	}
	this.buf.add("g");
}
haxe.Serializer.prototype.serializeRef = function(v) {
	var vt = typeof(v);
	{
		var _g1 = 0, _g = this.cache.length;
		while(_g1 < _g) {
			var i = _g1++;
			var ci = this.cache[i];
			if(typeof(ci) == vt && ci == v) {
				this.buf.add("r");
				this.buf.add(i);
				return true;
			}
		}
	}
	this.cache.push(v);
	return false;
}
haxe.Serializer.prototype.serializeString = function(s) {
	var x = this.shash.get(s);
	if(x != null) {
		this.buf.add("R");
		this.buf.add(x);
		return;
	}
	this.shash.set(s,this.scount++);
	this.buf.add("y");
	s = StringTools.urlEncode(s);
	this.buf.add(s.length);
	this.buf.add(":");
	this.buf.add(s);
}
haxe.Serializer.prototype.shash = null;
haxe.Serializer.prototype.toString = function() {
	return this.buf.b.join("");
}
haxe.Serializer.prototype.useCache = null;
haxe.Serializer.prototype.useEnumIndex = null;
haxe.Serializer.prototype.__class__ = haxe.Serializer;
List = function(p) { if( p === $_ ) return; {
	this.length = 0;
}}
List.__name__ = ["List"];
List.prototype.add = function(item) {
	var x = [item];
	if(this.h == null) this.h = x;
	else this.q[1] = x;
	this.q = x;
	this.length++;
}
List.prototype.clear = function() {
	this.h = null;
	this.q = null;
	this.length = 0;
}
List.prototype.filter = function(f) {
	var l2 = new List();
	var l = this.h;
	while(l != null) {
		var v = l[0];
		l = l[1];
		if(f(v)) l2.add(v);
	}
	return l2;
}
List.prototype.first = function() {
	return (this.h == null?null:this.h[0]);
}
List.prototype.h = null;
List.prototype.isEmpty = function() {
	return (this.h == null);
}
List.prototype.iterator = function() {
	return { h : this.h, hasNext : function() {
		return (this.h != null);
	}, next : function() {
		if(this.h == null) return null;
		var x = this.h[0];
		this.h = this.h[1];
		return x;
	}}
}
List.prototype.join = function(sep) {
	var s = new StringBuf();
	var first = true;
	var l = this.h;
	while(l != null) {
		if(first) first = false;
		else s.b[s.b.length] = sep;
		s.b[s.b.length] = l[0];
		l = l[1];
	}
	return s.b.join("");
}
List.prototype.last = function() {
	return (this.q == null?null:this.q[0]);
}
List.prototype.length = null;
List.prototype.map = function(f) {
	var b = new List();
	var l = this.h;
	while(l != null) {
		var v = l[0];
		l = l[1];
		b.add(f(v));
	}
	return b;
}
List.prototype.pop = function() {
	if(this.h == null) return null;
	var x = this.h[0];
	this.h = this.h[1];
	if(this.h == null) this.q = null;
	this.length--;
	return x;
}
List.prototype.push = function(item) {
	var x = [item,this.h];
	this.h = x;
	if(this.q == null) this.q = x;
	this.length++;
}
List.prototype.q = null;
List.prototype.remove = function(v) {
	var prev = null;
	var l = this.h;
	while(l != null) {
		if(l[0] == v) {
			if(prev == null) this.h = l[1];
			else prev[1] = l[1];
			if(this.q == l) this.q = prev;
			this.length--;
			return true;
		}
		prev = l;
		l = l[1];
	}
	return false;
}
List.prototype.toString = function() {
	var s = new StringBuf();
	var first = true;
	var l = this.h;
	s.b[s.b.length] = "{";
	while(l != null) {
		if(first) first = false;
		else s.b[s.b.length] = ", ";
		s.b[s.b.length] = Std.string(l[0]);
		l = l[1];
	}
	s.b[s.b.length] = "}";
	return s.b.join("");
}
List.prototype.__class__ = List;
org.casalib.util.ArrayUtil = function() { }
org.casalib.util.ArrayUtil.__name__ = ["org","casalib","util","ArrayUtil"];
org.casalib.util.ArrayUtil.indexOf = function(inArray,match,fromIndex) {
	if(fromIndex == null) fromIndex = 0;
	var i = fromIndex - 1;
	while(++i < inArray.length) {
		if(inArray[i] == match) return i;
	}
	return -1;
}
org.casalib.util.ArrayUtil.lastIndexOf = function(inArray,match,fromIndex) {
	var i;
	if(fromIndex == null) {
		i = inArray.length;
	}
	else {
		i = Math.round(Math.min(inArray.length,fromIndex + 1));
	}
	while(--i > 0) {
		if(inArray[i] == match) return i;
	}
	return -1;
}
org.casalib.util.ArrayUtil.filter = function(inArray,callBack) {
	var newArray = [];
	var iter = new IntIter(0,inArray.length);
	{ var $it0 = iter;
	while( $it0.hasNext() ) { var i = $it0.next();
	{
		if(callBack(inArray[i],i,inArray)) {
			newArray.push(inArray[i]);
		}
	}
	}}
	return newArray;
}
org.casalib.util.ArrayUtil.sortOn = function(inArray,fieldNames,options) {
	if(options == null) options = 0;
	var result = [];
	if(inArray.length != 0) {
		var oNumeric = (options >> 4 & 1) == 1;
		var oReturnindexedarray = (options >> 3 & 1) == 1;
		var oUniquesort = (options >> 2 & 1) == 1;
		var oDescending = (options >> 1 & 1) == 1;
		var oCaseinsensitive = (options & 1) == 1;
		var hasDup = false;
		if(oUniquesort) {
			var testCase = new Array();
			{
				var _g1 = 0, _g = inArray.length;
				while(_g1 < _g) {
					var i = _g1++;
					testCase[i] = new Array();
					{
						var _g2 = 0;
						while(_g2 < fieldNames.length) {
							var f = fieldNames[_g2];
							++_g2;
							var fi = Reflect.field(inArray[i],f);
							var isString = !(Std["is"](fi,Float) || Std["is"](fi,Int));
							var ele = ((oCaseinsensitive && isString)?Std.string(fi).toLowerCase():inArray[i]);
							testCase[i].push(ele);
						}
					}
				}
			}
			var removedDup = org.casalib.util.ArrayUtil.removeDuplicates2(testCase);
			if(removedDup.length != testCase.length) hasDup = true;
		}
		if(!hasDup) {
			var sortArray = (oReturnindexedarray?inArray.copy():inArray);
			sortArray.sort(org.casalib.util.ArrayUtil.getSortingFunction(oNumeric,oReturnindexedarray,oUniquesort,oDescending,oCaseinsensitive,fieldNames));
			if(!oReturnindexedarray) {
				result = sortArray;
			}
			else {
				var usedArray = new Array();
				{
					var _g = 0;
					while(_g < inArray.length) {
						var e = inArray[_g];
						++_g;
						usedArray.push(false);
					}
				}
				{
					var _g = 0;
					while(_g < inArray.length) {
						var e = inArray[_g];
						++_g;
						var index = 0;
						do {
							index = org.casalib.util.ArrayUtil.indexOf(sortArray,e,index);
						} while((index < usedArray.length) && (usedArray[index] == true));
						usedArray[index] = true;
						result.push(index);
					}
				}
			}
		}
	}
	return result;
}
org.casalib.util.ArrayUtil.sortOnLite = function(inArray,fieldNames,options) {
	if(options == null) options = 0;
	var result = [];
	if(inArray.length != 0) {
		var oNumeric = (options >> 4 & 1) == 1;
		var oUniquesort = (options >> 2 & 1) == 1;
		var oDescending = (options >> 1 & 1) == 1;
		var oCaseinsensitive = (options & 1) == 1;
		var hasDup = false;
		if(oUniquesort) {
			var testCase = new Array();
			{
				var _g1 = 0, _g = inArray.length;
				while(_g1 < _g) {
					var i = _g1++;
					testCase[i] = new Array();
					{
						var _g2 = 0;
						while(_g2 < fieldNames.length) {
							var f = fieldNames[_g2];
							++_g2;
							var fi = Reflect.field(inArray[i],f);
							var isString = !(Std["is"](fi,Float) || Std["is"](fi,Int));
							var ele;
							if(oCaseinsensitive && isString) {
								ele = Std.string(fi).toLowerCase();
							}
							else {
								ele = inArray[i];
							}
							testCase[i].push(ele);
						}
					}
				}
			}
			var removedDup = org.casalib.util.ArrayUtil.removeDuplicates2(testCase);
			if(removedDup.length != testCase.length) hasDup = true;
		}
		if(!hasDup) {
			inArray.sort(org.casalib.util.ArrayUtil.getSortingFunction(oNumeric,false,oUniquesort,oDescending,oCaseinsensitive,fieldNames));
			result = inArray;
		}
	}
	return result;
}
org.casalib.util.ArrayUtil.indicesOfSorted = function(inArray,fieldNames,options) {
	if(options == null) options = 0;
	var result = [];
	var sortArray = org.casalib.util.ArrayUtil.sortOnLite(inArray.copy(),fieldNames,options);
	if(sortArray.length != 0) {
		var usedArray = new Array();
		{
			var _g = 0;
			while(_g < inArray.length) {
				var e = inArray[_g];
				++_g;
				usedArray.push(false);
			}
		}
		{
			var _g = 0;
			while(_g < inArray.length) {
				var e = inArray[_g];
				++_g;
				var index = 0;
				do {
					index = org.casalib.util.ArrayUtil.indexOf(sortArray,e,index);
				} while((index < usedArray.length) && (usedArray[index] == true));
				usedArray[index] = true;
				result.push(index);
			}
		}
	}
	return result;
}
org.casalib.util.ArrayUtil.getSortingFunction = function(oNumeric,oReturnindexedarray,oUniquesort,oDescending,oCaseinsensitive,fieldNames) {
	return function(a,b) {
		var r = 0;
		{
			var _g = 0;
			while(_g < fieldNames.length) {
				var f = fieldNames[_g];
				++_g;
				var af = Reflect.field(a,f);
				var bf = Reflect.field(b,f);
				if(!oNumeric) {
					if(Std["is"](af,Float) || Std["is"](af,Int)) {
						af = Std.string(af);
					}
					if(Std["is"](bf,Float) || Std["is"](bf,Int)) {
						bf = Std.string(bf);
					}
				}
				if(oCaseinsensitive) {
					if(Std["is"](af,String)) {
						af = af.toLowerCase();
					}
					if(Std["is"](bf,String)) {
						bf = bf.toLowerCase();
					}
				}
				if(af != bf) {
					if(!oDescending) {
						if(!oNumeric) {
							r = (org.casalib.util.ArrayUtil.strcmp(af,bf) > 0?1:-1);
						}
						else {
							r = (af > bf?1:-1);
						}
					}
					else {
						if(!oNumeric) {
							r = (org.casalib.util.ArrayUtil.strcmp(af,bf) < 0?1:-1);
						}
						else {
							r = (af < bf?1:-1);
						}
					}
				}
			}
		}
		return r;
	}
}
org.casalib.util.ArrayUtil.strcmp = function(s0,s1) {
	var r = s0.length - s1.length;
	{
		var _g1 = 0, _g = Math.floor(Math.min(s0.length,s1.length));
		while(_g1 < _g) {
			var i = _g1++;
			if(s0.charAt(i) != s1.charAt(i)) {
				r = s0.charCodeAt(i) - s1.charCodeAt(i);
				break;
			}
		}
	}
	return r;
}
org.casalib.util.ArrayUtil.removeDuplicates2 = function(inArray) {
	var i = 0;
	var cp = inArray.copy();
	var outArray = inArray.copy();
	{
		var _g = 0;
		while(_g < cp.length) {
			var i1 = cp[_g];
			++_g;
			{
				var _g2 = 1, _g1 = org.casalib.util.ArrayUtil.contains2(outArray,i1);
				while(_g2 < _g1) {
					var j = _g2++;
					outArray.remove(i1);
				}
			}
		}
	}
	return outArray;
}
org.casalib.util.ArrayUtil.contains2 = function(inArray,item) {
	var i = org.casalib.util.ArrayUtil.indexOf(inArray,item,0);
	var t = 0;
	while(i != -1) {
		i = org.casalib.util.ArrayUtil.indexOf2(inArray,item,i + 1);
		t++;
	}
	return t;
}
org.casalib.util.ArrayUtil.indexOf2 = function(inArray,match,fromIndex) {
	if(fromIndex == null) fromIndex = 0;
	var i = fromIndex - 1;
	while(++i < inArray.length) {
		if(org.casalib.util.ArrayUtil.equals(inArray[i],match)) return i;
	}
	return -1;
}
org.casalib.util.ArrayUtil.getItemByKeys = function(inArray,keyValues) {
	var i = -1;
	var item;
	var hasKeys;
	while(++i < inArray.length) {
		item = inArray[i];
		hasKeys = true;
		{
			var _g = 0, _g1 = org.casalib.util.ObjectUtil.getKeys(keyValues);
			while(_g < _g1.length) {
				var j = _g1[_g];
				++_g;
				var val = Reflect.field(item,j);
				var val2 = Reflect.field(keyValues,j);
				if(val == null || val != val2) hasKeys = false;
			}
		}
		if(hasKeys) return item;
	}
	return null;
}
org.casalib.util.ArrayUtil.getItemsByKeys = function(inArray,keyValues) {
	var t = new Array();
	var i = -1;
	var item;
	var hasKeys;
	while(++i < inArray.length) {
		item = inArray[i];
		hasKeys = true;
		{
			var _g = 0, _g1 = org.casalib.util.ObjectUtil.getKeys(keyValues);
			while(_g < _g1.length) {
				var j = _g1[_g];
				++_g;
				var val = Reflect.field(item,j);
				var val2 = Reflect.field(keyValues,j);
				if(val == null || val != val2) hasKeys = false;
			}
		}
		if(hasKeys) t.push(item);
	}
	return t;
}
org.casalib.util.ArrayUtil.getItemByAnyKey = function(inArray,keyValues) {
	var i = -1;
	var item;
	while(++i < inArray.length) {
		item = inArray[i];
		{
			var _g = 0, _g1 = org.casalib.util.ObjectUtil.getKeys(keyValues);
			while(_g < _g1.length) {
				var j = _g1[_g];
				++_g;
				var val = Reflect.field(item,j);
				var val2 = Reflect.field(keyValues,j);
				if(val != null && val == val2) return item;
			}
		}
	}
	return null;
}
org.casalib.util.ArrayUtil.getItemsByAnyKey = function(inArray,keyValues) {
	var t = new Array();
	var i = -1;
	var item;
	var hasKeys = false;
	while(++i < inArray.length) {
		item = inArray[i];
		hasKeys = true;
		{
			var _g = 0, _g1 = org.casalib.util.ObjectUtil.getKeys(keyValues);
			while(_g < _g1.length) {
				var j = _g1[_g];
				++_g;
				var val = Reflect.field(item,j);
				var val2 = Reflect.field(keyValues,j);
				if(val != null && val == val2) {
					t.push(item);
					break;
				}
			}
		}
	}
	return t;
}
org.casalib.util.ArrayUtil.getItemByKey = function(inArray,key,match) {
	{
		var _g = 0;
		while(_g < inArray.length) {
			var item = inArray[_g];
			++_g;
			var value = Reflect.field(item,key);
			if(value != null && value == match) return item;
		}
	}
	return null;
}
org.casalib.util.ArrayUtil.getItemsByKey = function(inArray,key,match) {
	var t = new Array();
	{
		var _g = 0;
		while(_g < inArray.length) {
			var item = inArray[_g];
			++_g;
			var value = Reflect.field(item,key);
			if(value != null && value == match) t.push(item);
		}
	}
	return t;
}
org.casalib.util.ArrayUtil.getItemByType = function(inArray,type) {
	{
		var _g = 0;
		while(_g < inArray.length) {
			var item = inArray[_g];
			++_g;
			if(Std["is"](item,type)) return item;
		}
	}
	return null;
}
org.casalib.util.ArrayUtil.getItemsByType = function(inArray,type) {
	var t = new Array();
	{
		var _g = 0;
		while(_g < inArray.length) {
			var item = inArray[_g];
			++_g;
			if(Std["is"](item,type)) t.push(item);
		}
	}
	return t;
}
org.casalib.util.ArrayUtil.getValuesByKey = function(inArray,key) {
	var k = new Array();
	{
		var _g = 0;
		while(_g < inArray.length) {
			var item = inArray[_g];
			++_g;
			var v = Reflect.field(item,key);
			if(v != null) k.push(v);
		}
	}
	return k;
}
org.casalib.util.ArrayUtil.equals = function(first,second) {
	var i = first.length;
	var result = true;
	if(i != second.length) {
		result = false;
	}
	else {
		while(i-- > 0) {
			if(first[i] != second[i]) {
				result = false;
				break;
			}
		}
	}
	return result;
}
org.casalib.util.ArrayUtil.addItemsAt = function(tarArray,items,index) {
	if(index == null) index = 2147483647;
	if(items.length == 0) {
		return false;
	}
	else {
		var i = -1;
		while(++i < items.length) {
			tarArray.insert(index++,items[i]);
		}
		return true;
	}
}
org.casalib.util.ArrayUtil.removeDuplicates = function(inArray) {
	var i = 0;
	var cp = inArray.copy();
	var outArray = inArray.copy();
	{
		var _g = 0;
		while(_g < cp.length) {
			var i1 = cp[_g];
			++_g;
			{
				var _g2 = 1, _g1 = org.casalib.util.ArrayUtil.contains(outArray,i1);
				while(_g2 < _g1) {
					var j = _g2++;
					outArray.remove(i1);
				}
			}
		}
	}
	return outArray;
}
org.casalib.util.ArrayUtil.removeItem = function(tarArray,item) {
	var i = org.casalib.util.ArrayUtil.indexOf(tarArray,item);
	var f = 0;
	while(i != -1) {
		tarArray.splice(i,1);
		i = org.casalib.util.ArrayUtil.indexOf(tarArray,item,i);
		f++;
	}
	return f;
}
org.casalib.util.ArrayUtil.removeItems = function(tarArray,items) {
	var removed = false;
	var l = tarArray.length;
	while(l-- > 0) {
		if(org.casalib.util.ArrayUtil.indexOf(items,tarArray[l]) > -1) {
			tarArray.splice(l,1);
			removed = true;
		}
	}
	return removed;
}
org.casalib.util.ArrayUtil.retainItems = function(tarArray,items) {
	var removed = false;
	var l = tarArray.length;
	while(l-- > 0) {
		if(org.casalib.util.ArrayUtil.indexOf(items,tarArray[l]) == -1) {
			tarArray.splice(l,1);
			removed = true;
		}
	}
	return removed;
}
org.casalib.util.ArrayUtil.contains = function(inArray,item) {
	var i = org.casalib.util.ArrayUtil.indexOf(inArray,item,0);
	var t = 0;
	while(i != -1) {
		i = org.casalib.util.ArrayUtil.indexOf(inArray,item,i + 1);
		t++;
	}
	return t;
}
org.casalib.util.ArrayUtil.containsAll = function(inArray,items) {
	var l = items.length;
	while(l-- > 0) if(org.casalib.util.ArrayUtil.indexOf(inArray,items[l]) == -1) return false;
	return true;
}
org.casalib.util.ArrayUtil.containsAny = function(inArray,items) {
	var l = items.length;
	while(l-- > 0) if(org.casalib.util.ArrayUtil.indexOf(inArray,items[l]) > -1) return true;
	return false;
}
org.casalib.util.ArrayUtil.getIndexOfDifference = function(first,second,fromIndex) {
	if(fromIndex == null) fromIndex = 0;
	var i = fromIndex - 1;
	while(++i < first.length) if(first[i] != second[i]) return i;
	return -1;
}
org.casalib.util.ArrayUtil.random = function(inArray) {
	return org.casalib.util.ArrayUtil.randomize(inArray)[0];
}
org.casalib.util.ArrayUtil.randomize = function(inArray) {
	var t = new Array();
	var c = inArray.copy();
	while(c.length > 0) t.push(c.splice(Math.round((Math.random() * (c.length - 1))),1)[0]);
	return t;
}
org.casalib.util.ArrayUtil.sum = function(inArray) {
	var t = 0;
	var l = inArray.length;
	while(l-- > 0) t += inArray[l];
	return t;
}
org.casalib.util.ArrayUtil.average = function(inArray) {
	if(inArray.length == 0) return 0;
	return org.casalib.util.ArrayUtil.sum(inArray) / inArray.length;
}
org.casalib.util.ArrayUtil.getLowestValue = function(inArray) {
	var lowest = inArray[0];
	{
		var _g = 0;
		while(_g < inArray.length) {
			var i = inArray[_g];
			++_g;
			lowest = org.casalib.util.NumberUtil.min(i,lowest);
		}
	}
	return lowest;
}
org.casalib.util.ArrayUtil.getHighestValue = function(inArray) {
	var lowest = inArray[0];
	{
		var _g = 0;
		while(_g < inArray.length) {
			var i = inArray[_g];
			++_g;
			lowest = org.casalib.util.NumberUtil.max(i,lowest);
		}
	}
	return lowest;
}
org.casalib.util.ArrayUtil.prototype.__class__ = org.casalib.util.ArrayUtil;
ValueType = { __ename__ : ["ValueType"], __constructs__ : ["TNull","TInt","TFloat","TBool","TObject","TFunction","TClass","TEnum","TUnknown"] }
ValueType.TBool = ["TBool",3];
ValueType.TBool.toString = $estr;
ValueType.TBool.__enum__ = ValueType;
ValueType.TClass = function(c) { var $x = ["TClass",6,c]; $x.__enum__ = ValueType; $x.toString = $estr; return $x; }
ValueType.TEnum = function(e) { var $x = ["TEnum",7,e]; $x.__enum__ = ValueType; $x.toString = $estr; return $x; }
ValueType.TFloat = ["TFloat",2];
ValueType.TFloat.toString = $estr;
ValueType.TFloat.__enum__ = ValueType;
ValueType.TFunction = ["TFunction",5];
ValueType.TFunction.toString = $estr;
ValueType.TFunction.__enum__ = ValueType;
ValueType.TInt = ["TInt",1];
ValueType.TInt.toString = $estr;
ValueType.TInt.__enum__ = ValueType;
ValueType.TNull = ["TNull",0];
ValueType.TNull.toString = $estr;
ValueType.TNull.__enum__ = ValueType;
ValueType.TObject = ["TObject",4];
ValueType.TObject.toString = $estr;
ValueType.TObject.__enum__ = ValueType;
ValueType.TUnknown = ["TUnknown",8];
ValueType.TUnknown.toString = $estr;
ValueType.TUnknown.__enum__ = ValueType;
if(typeof js=='undefined') js = {}
js.Lib = function() { }
js.Lib.__name__ = ["js","Lib"];
js.Lib.isIE = null;
js.Lib.isOpera = null;
js.Lib.document = null;
js.Lib.window = null;
js.Lib.alert = function(v) {
	alert(js.Boot.__string_rec(v,""));
}
js.Lib.eval = function(code) {
	return eval(code);
}
js.Lib.setErrorHandler = function(f) {
	js.Lib.onerror = f;
}
js.Lib.prototype.__class__ = js.Lib;
js.Boot = function() { }
js.Boot.__name__ = ["js","Boot"];
js.Boot.__unhtml = function(s) {
	return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}
js.Boot.__trace = function(v,i) {
	var msg = (i != null?((i.fileName + ":") + i.lineNumber) + ": ":"");
	msg += js.Boot.__unhtml(js.Boot.__string_rec(v,"")) + "<br/>";
	var d = document.getElementById("haxe:trace");
	if(d == null) alert("No haxe:trace element defined\n" + msg);
	else d.innerHTML += msg;
}
js.Boot.__clear_trace = function() {
	var d = document.getElementById("haxe:trace");
	if(d != null) d.innerHTML = "";
	else null;
}
js.Boot.__closure = function(o,f) {
	var m = o[f];
	if(m == null) return null;
	var f1 = function() {
		return m.apply(o,arguments);
	}
	f1.scope = o;
	f1.method = m;
	return f1;
}
js.Boot.__string_rec = function(o,s) {
	if(o == null) return "null";
	if(s.length >= 5) return "<...>";
	var t = typeof(o);
	if(t == "function" && (o.__name__ != null || o.__ename__ != null)) t = "object";
	switch(t) {
	case "object":{
		if(o instanceof Array) {
			if(o.__enum__ != null) {
				if(o.length == 2) return o[0];
				var str = o[0] + "(";
				s += "\t";
				{
					var _g1 = 2, _g = o.length;
					while(_g1 < _g) {
						var i = _g1++;
						if(i != 2) str += "," + js.Boot.__string_rec(o[i],s);
						else str += js.Boot.__string_rec(o[i],s);
					}
				}
				return str + ")";
			}
			var l = o.length;
			var i;
			var str = "[";
			s += "\t";
			{
				var _g = 0;
				while(_g < l) {
					var i1 = _g++;
					str += ((i1 > 0?",":"")) + js.Boot.__string_rec(o[i1],s);
				}
			}
			str += "]";
			return str;
		}
		var tostr;
		try {
			tostr = o.toString;
		}
		catch( $e0 ) {
			{
				var e = $e0;
				{
					return "???";
				}
			}
		}
		if(tostr != null && tostr != Object.toString) {
			var s2 = o.toString();
			if(s2 != "[object Object]") return s2;
		}
		var k = null;
		var str = "{\n";
		s += "\t";
		var hasp = (o.hasOwnProperty != null);
		for( var k in o ) { ;
		if(hasp && !o.hasOwnProperty(k)) continue;
		if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__") continue;
		if(str.length != 2) str += ", \n";
		str += ((s + k) + " : ") + js.Boot.__string_rec(o[k],s);
		}
		s = s.substring(1);
		str += ("\n" + s) + "}";
		return str;
	}break;
	case "function":{
		return "<function>";
	}break;
	case "string":{
		return o;
	}break;
	default:{
		return String(o);
	}break;
	}
}
js.Boot.__interfLoop = function(cc,cl) {
	if(cc == null) return false;
	if(cc == cl) return true;
	var intf = cc.__interfaces__;
	if(intf != null) {
		var _g1 = 0, _g = intf.length;
		while(_g1 < _g) {
			var i = _g1++;
			var i1 = intf[i];
			if(i1 == cl || js.Boot.__interfLoop(i1,cl)) return true;
		}
	}
	return js.Boot.__interfLoop(cc.__super__,cl);
}
js.Boot.__instanceof = function(o,cl) {
	try {
		if(o instanceof cl) {
			if(cl == Array) return (o.__enum__ == null);
			return true;
		}
		if(js.Boot.__interfLoop(o.__class__,cl)) return true;
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				if(cl == null) return false;
			}
		}
	}
	switch(cl) {
	case Int:{
		return Math.ceil(o%2147483648.0) === o;
	}break;
	case Float:{
		return typeof(o) == "number";
	}break;
	case Bool:{
		return o === true || o === false;
	}break;
	case String:{
		return typeof(o) == "string";
	}break;
	case Dynamic:{
		return true;
	}break;
	default:{
		if(o == null) return false;
		return o.__enum__ == cl || (cl == Class && o.__name__ != null) || (cl == Enum && o.__ename__ != null);
	}break;
	}
}
js.Boot.__init = function() {
	js.Lib.isIE = (typeof document!='undefined' && document.all != null && typeof window!='undefined' && window.opera == null);
	js.Lib.isOpera = (typeof window!='undefined' && window.opera != null);
	Array.prototype.copy = Array.prototype.slice;
	Array.prototype.insert = function(i,x) {
		this.splice(i,0,x);
	}
	Array.prototype.remove = (Array.prototype.indexOf?function(obj) {
		var idx = this.indexOf(obj);
		if(idx == -1) return false;
		this.splice(idx,1);
		return true;
	}:function(obj) {
		var i = 0;
		var l = this.length;
		while(i < l) {
			if(this[i] == obj) {
				this.splice(i,1);
				return true;
			}
			i++;
		}
		return false;
	});
	Array.prototype.iterator = function() {
		return { cur : 0, arr : this, hasNext : function() {
			return this.cur < this.arr.length;
		}, next : function() {
			return this.arr[this.cur++];
		}}
	}
	var cca = String.prototype.charCodeAt;
	String.prototype.cca = cca;
	String.prototype.charCodeAt = function(i) {
		var x = cca.call(this,i);
		if(isNaN(x)) return null;
		return x;
	}
	var oldsub = String.prototype.substr;
	String.prototype.substr = function(pos,len) {
		if(pos != null && pos != 0 && len != null && len < 0) return "";
		if(len == null) len = this.length;
		if(pos < 0) {
			pos = this.length + pos;
			if(pos < 0) pos = 0;
		}
		else if(len < 0) {
			len = (this.length + len) - pos;
		}
		return oldsub.apply(this,[pos,len]);
	}
	$closure = js.Boot.__closure;
}
js.Boot.prototype.__class__ = js.Boot;
IntHash = function(p) { if( p === $_ ) return; {
	this.h = {}
	if(this.h.__proto__ != null) {
		this.h.__proto__ = null;
		delete(this.h.__proto__);
	}
	else null;
}}
IntHash.__name__ = ["IntHash"];
IntHash.prototype.exists = function(key) {
	return this.h[key] != null;
}
IntHash.prototype.get = function(key) {
	return this.h[key];
}
IntHash.prototype.h = null;
IntHash.prototype.iterator = function() {
	return { ref : this.h, it : this.keys(), hasNext : function() {
		return this.it.hasNext();
	}, next : function() {
		var i = this.it.next();
		return this.ref[i];
	}}
}
IntHash.prototype.keys = function() {
	var a = new Array();
	
			for( x in this.h )
				a.push(x);
		;
	return a.iterator();
}
IntHash.prototype.remove = function(key) {
	if(this.h[key] == null) return false;
	delete(this.h[key]);
	return true;
}
IntHash.prototype.set = function(key,value) {
	this.h[key] = value;
}
IntHash.prototype.toString = function() {
	var s = new StringBuf();
	s.b[s.b.length] = "{";
	var it = this.keys();
	{ var $it0 = it;
	while( $it0.hasNext() ) { var i = $it0.next();
	{
		s.b[s.b.length] = i;
		s.b[s.b.length] = " => ";
		s.b[s.b.length] = Std.string(this.get(i));
		if(it.hasNext()) s.b[s.b.length] = ", ";
	}
	}}
	s.b[s.b.length] = "}";
	return s.b.join("");
}
IntHash.prototype.__class__ = IntHash;
DateTools = function() { }
DateTools.__name__ = ["DateTools"];
DateTools.__format_get = function(d,e) {
	return (function($this) {
		var $r;
		switch(e) {
		case "%":{
			$r = "%";
		}break;
		case "C":{
			$r = StringTools.lpad(Std.string(Std["int"](d.getFullYear() / 100)),"0",2);
		}break;
		case "d":{
			$r = StringTools.lpad(Std.string(d.getDate()),"0",2);
		}break;
		case "D":{
			$r = DateTools.__format(d,"%m/%d/%y");
		}break;
		case "e":{
			$r = Std.string(d.getDate());
		}break;
		case "H":case "k":{
			$r = StringTools.lpad(Std.string(d.getHours()),(e == "H"?"0":" "),2);
		}break;
		case "I":case "l":{
			$r = (function($this) {
				var $r;
				var hour = d.getHours() % 12;
				$r = StringTools.lpad(Std.string((hour == 0?12:hour)),(e == "I"?"0":" "),2);
				return $r;
			}($this));
		}break;
		case "m":{
			$r = StringTools.lpad(Std.string(d.getMonth() + 1),"0",2);
		}break;
		case "M":{
			$r = StringTools.lpad(Std.string(d.getMinutes()),"0",2);
		}break;
		case "n":{
			$r = "\n";
		}break;
		case "p":{
			$r = (d.getHours() > 11?"PM":"AM");
		}break;
		case "r":{
			$r = DateTools.__format(d,"%I:%M:%S %p");
		}break;
		case "R":{
			$r = DateTools.__format(d,"%H:%M");
		}break;
		case "s":{
			$r = Std.string(Std["int"](d.getTime() / 1000));
		}break;
		case "S":{
			$r = StringTools.lpad(Std.string(d.getSeconds()),"0",2);
		}break;
		case "t":{
			$r = "\t";
		}break;
		case "T":{
			$r = DateTools.__format(d,"%H:%M:%S");
		}break;
		case "u":{
			$r = (function($this) {
				var $r;
				var t = d.getDay();
				$r = (t == 0?"7":Std.string(t));
				return $r;
			}($this));
		}break;
		case "w":{
			$r = Std.string(d.getDay());
		}break;
		case "y":{
			$r = StringTools.lpad(Std.string(d.getFullYear() % 100),"0",2);
		}break;
		case "Y":{
			$r = Std.string(d.getFullYear());
		}break;
		default:{
			$r = (function($this) {
				var $r;
				throw ("Date.format %" + e) + "- not implemented yet.";
				return $r;
			}($this));
		}break;
		}
		return $r;
	}(this));
}
DateTools.__format = function(d,f) {
	var r = new StringBuf();
	var p = 0;
	while(true) {
		var np = f.indexOf("%",p);
		if(np < 0) break;
		r.b[r.b.length] = f.substr(p,np - p);
		r.b[r.b.length] = DateTools.__format_get(d,f.substr(np + 1,1));
		p = np + 2;
	}
	r.b[r.b.length] = f.substr(p,f.length - p);
	return r.b.join("");
}
DateTools.format = function(d,f) {
	return DateTools.__format(d,f);
}
DateTools.delta = function(d,t) {
	return Date.fromTime(d.getTime() + t);
}
DateTools.getMonthDays = function(d) {
	var month = d.getMonth();
	var year = d.getFullYear();
	if(month != 1) return DateTools.DAYS_OF_MONTH[month];
	var isB = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
	return (isB?29:28);
}
DateTools.seconds = function(n) {
	return n * 1000.0;
}
DateTools.minutes = function(n) {
	return (n * 60.0) * 1000.0;
}
DateTools.hours = function(n) {
	return ((n * 60.0) * 60.0) * 1000.0;
}
DateTools.days = function(n) {
	return (((n * 24.0) * 60.0) * 60.0) * 1000.0;
}
DateTools.parse = function(t) {
	var s = t / 1000;
	var m = s / 60;
	var h = m / 60;
	return { ms : t % 1000, seconds : Std["int"](s % 60), minutes : Std["int"](m % 60), hours : Std["int"](h % 24), days : Std["int"](h / 24)}
}
DateTools.make = function(o) {
	return o.ms + 1000.0 * (o.seconds + 60.0 * (o.minutes + 60.0 * (o.hours + 24.0 * o.days)));
}
DateTools.prototype.__class__ = DateTools;
org.casalib.util.QueryStringUtil = function() { }
org.casalib.util.QueryStringUtil.__name__ = ["org","casalib","util","QueryStringUtil"];
org.casalib.util.QueryStringUtil.queryString = null;
org.casalib.util.QueryStringUtil._query = null;
org.casalib.util.QueryStringUtil._hasRequested = null;
org.casalib.util.QueryStringUtil._pairMap = null;
org.casalib.util.QueryStringUtil.getQueryString = function() {
	if(!org.casalib.util.QueryStringUtil._hasRequested) {
		org.casalib.util.QueryStringUtil._hasRequested = true;
		var query = null;
		query = js.Lib.window.location.search;
		if(query != null && query != "") {
			org.casalib.util.QueryStringUtil._query = (query.charAt(0) == "?"?query.substr(1):query);
			var pairs = org.casalib.util.QueryStringUtil._query.split("&");
			var i = -1;
			var pair;
			org.casalib.util.QueryStringUtil._pairMap = new Hash();
			while(++i < pairs.length) {
				pair = pairs[i].split("=");
				org.casalib.util.QueryStringUtil._pairMap.set(pair[0],pair[1]);
			}
		}
	}
	return org.casalib.util.QueryStringUtil._query;
}
org.casalib.util.QueryStringUtil.getValue = function(key) {
	if(org.casalib.util.QueryStringUtil.getQueryString() == null) return null;
	return org.casalib.util.QueryStringUtil._pairMap.get(key);
}
org.casalib.util.QueryStringUtil.hasKey = function(key) {
	return org.casalib.util.QueryStringUtil.getValue(key) != null;
}
org.casalib.util.QueryStringUtil.prototype.__class__ = org.casalib.util.QueryStringUtil;
Hash = function(p) { if( p === $_ ) return; {
	this.h = {}
	if(this.h.__proto__ != null) {
		this.h.__proto__ = null;
		delete(this.h.__proto__);
	}
	else null;
}}
Hash.__name__ = ["Hash"];
Hash.prototype.exists = function(key) {
	try {
		key = "$" + key;
		return this.hasOwnProperty.call(this.h,key);
	}
	catch( $e0 ) {
		{
			var e = $e0;
			{
				
				for(var i in this.h)
					if( i == key ) return true;
			;
				return false;
			}
		}
	}
}
Hash.prototype.get = function(key) {
	return this.h["$" + key];
}
Hash.prototype.h = null;
Hash.prototype.iterator = function() {
	return { ref : this.h, it : this.keys(), hasNext : function() {
		return this.it.hasNext();
	}, next : function() {
		var i = this.it.next();
		return this.ref["$" + i];
	}}
}
Hash.prototype.keys = function() {
	var a = new Array();
	
			for(var i in this.h)
				a.push(i.substr(1));
		;
	return a.iterator();
}
Hash.prototype.remove = function(key) {
	if(!this.exists(key)) return false;
	delete(this.h["$" + key]);
	return true;
}
Hash.prototype.set = function(key,value) {
	this.h["$" + key] = value;
}
Hash.prototype.toString = function() {
	var s = new StringBuf();
	s.b[s.b.length] = "{";
	var it = this.keys();
	{ var $it0 = it;
	while( $it0.hasNext() ) { var i = $it0.next();
	{
		s.b[s.b.length] = i;
		s.b[s.b.length] = " => ";
		s.b[s.b.length] = Std.string(this.get(i));
		if(it.hasNext()) s.b[s.b.length] = ", ";
	}
	}}
	s.b[s.b.length] = "}";
	return s.b.join("");
}
Hash.prototype.__class__ = Hash;
Main = function() { }
Main.__name__ = ["Main"];
Main.toPageId = function(str) {
	return org.casalib.util.StringUtil.getLettersFromString(str).toLowerCase();
}
Main.main = function() {
	new JQuery(function() {
		new JQuery("#breadcrumb li>a").each(function(i,e) {
			var link = new JQuery(e);
			Main.currentPage.push((link.attr("title").length > 0?Main.toPageId(link.attr("title")):Main.toPageId(link.text())));
		});
		if(Main.currentPage.length > 1) {
			Main.currentPage.shift();
		}
		new JQuery("#menu ul li.grid_3").each(function(i,e) {
			var j = new JQuery(e);
			var text = j.children("a").text();
			if(Main.toPageId(text) == Main.currentPage[0]) {
				j.addClass("current").addClass("highlight");
			}
		});
		new JQuery("<div></div>").addClass("floater").prependTo("#menu");
		var getFloaterTarget = function(useCurrent) {
			if(useCurrent == null) useCurrent = false;
			var ie6 = JQueryS.browser.msie && JQueryS.browser.version == "6.0";
			if(!useCurrent) {
				if(ie6) return new JQuery("#menu li.highlight").parent().position().left + 11;
				else return new JQuery("#menu li.highlight").position().left + 11;
			}
			else {
				if(ie6) return new JQuery("#menu li.current").parent().position().left + 11;
				else return new JQuery("#menu li.current").position().left + 11;
			}
		}
		new JQuery("#menu>ul").addClass("hasFloater").mouseenter(function(evt) {
			Main.cursorOnMenu = true;
		}).mouseleave(function(evt) {
			Main.cursorOnMenu = false;
			var jThis = new JQuery(evt.currentTarget);
			new JQuery("#menu li.highlight").removeClass("highlight");
			new JQuery("#menu li.current").addClass("highlight");
			new JQuery("#menu .floater").animate({ marginLeft : getFloaterTarget(true)},{ queue : false, duration : 300, easing : "easeInOutQuad"});
			new JQuery("#menu li").each(function(i,e) {
				var jThis1 = new JQuery(e);
				if(jThis1.hasClass("highlight")) {
					jThis1.children("a").animate({ color : "#ffffff"},{ queue : false, duration : 300});
				}
				else {
					jThis1.children("a").animate({ color : "#6a6a6a"},{ queue : false, duration : 300});
				}
			});
			new JQuery("#menu .sub").hide();
		});
		new JQuery("#menu ul li.grid_3").mouseover(function(evt) {
			var jThis = new JQuery(evt.currentTarget);
			Main.cursorOnMenu = true;
			if(jThis.hasClass("highlight")) {
				jThis.children(".sub").show();
				return;
			}
			new JQuery("#menu li.highlight").removeClass("highlight");
			jThis.addClass("highlight");
			new JQuery("#menu .floater").animate({ marginLeft : getFloaterTarget()},{ queue : false, duration : 300, easing : "easeInOutQuad", complete : function(evt1) {
				if(jThis.hasClass("highlight") && Main.cursorOnMenu) {
					new JQuery("#menu .sub").hide();
					jThis.children(".sub").show();
					new JQuery("#menu li").each(function(i,e) {
						var jThis1 = new JQuery(e);
						if(jThis1.hasClass("highlight")) {
							jThis1.children("a").animate({ color : "#ffffff"},{ queue : false, duration : 300});
						}
						else {
							jThis1.children("a").animate({ color : "#6a6a6a"},{ queue : false, duration : 300});
						}
					});
				}
			}});
		});
		new JQuery("#menu .sub>li").each(function(i,e) {
			var cur = new JQuery(e);
			if(Lambda.has(Main.currentPage,Main.toPageId(cur.children("a").text()))) cur.addClass("current-page");
		}).hover(function(evt) {
			new JQuery(evt.currentTarget).children("a").animate({ color : "#000000"},{ queue : false, duration : 300});
		},function(evt) {
			new JQuery(evt.currentTarget).children("a").animate({ color : "#6a6a6a"},{ queue : false, duration : 300});
		});
		new JQuery("#menu .sub>li a").css("color","#6a6a6a");
		new JQuery("#menu .floater").css("marginLeft",getFloaterTarget(true));
		new JQuery("#menu a[href=#]").click(function(evt) {
			evt.preventDefault();
		});
		var submenu = new JQuery("#body > .side-bar .submenu");
		if(submenu.length > 0) {
			submenu.children("li").each(function(i,e) {
				var li = new JQuery(e);
				if(Main.currentPage[1] == Main.toPageId(li.children("a").text())) {
					li.addClass("current-page");
					var level = 1;
					while(++level < Main.currentPage.length) {
						li.children("ul").children("li").each(function(i1,e1) {
							var _li = new JQuery(e1);
							if(Main.currentPage[level] == Main.toPageId(_li.children("a").text())) {
								li = _li;
							}
						});
						li.addClass("current-page");
					}
				}
				else {
					li.children("ul").hide();
					if(org.casalib.util.QueryStringUtil.getValue("submenu-click") == "false") {
						li.hover(function(evt) {
							new JQuery(evt.currentTarget).children("ul").stop(true,true).slideDown({ easing : "easeInOutQuad"});
						},function(evt) {
							new JQuery(evt.currentTarget).children("ul").stop(true,true).slideUp({ easing : "easeInOutQuad"});
						});
					}
					else {
						if(li.children("ul").length > 0) {
							li.children("a").toggle(function(evt) {
								new JQuery(evt.currentTarget).siblings("ul").stop(true,true).slideDown({ easing : "easeInOutQuad"});
							},function(evt) {
								new JQuery(evt.currentTarget).siblings("ul").stop(true,true).slideUp({ easing : "easeInOutQuad"});
							});
						}
					}
				}
			});
		}
		new JQuery(".search .search-field").labelify({ labelledClass : "labeled"});
		new JQuery(".search .search-submit").click(function(evt) {
			new JQuery(evt.target).closest("form").submit();
		});
		new JQuery(".print").click(function(evt) {
			js.Lib.window.print();
		});
		new JQuery("#edge-feed").tooltip({ tip : "#edge-feed-detail", relative : true, offset : [15,-50], delay : 100});
		var albums = new JQuery(".photo-album");
		if(albums.length > 0) {
			new JQuery("body").append("<div id=\"photo-album-overlay\"><a class=\"close png\"></a><div class=\"contentWrap\"></div></div>");
			albums.find("a").overlay({ target : "#photo-album-overlay", close : ".close", mask : { color : "black", opacity : 0.9, zIndex : 9000}, top : "center", onBeforeLoad : function(evt) {
				var api = evt.target;
				api.getOverlay().find(".contentWrap").html(("<img src='" + api.getTrigger().attr("href")) + "'/>");
			}});
		}
		new JQuery(".edge #body .content a").each(function(i,e) {
			var href = new JQuery(e).attr("href");
			if(StringTools.startsWith(href,"http://") && href.split("cityu.edu.hk/edge").length - 1 == 0 && href.split("cityu.edu.hk/ge").length - 1 == 0) {
				var j = new JQuery(e);
				j.addClass("external-link");
				if(!j.attr("target")) j.attr("target","_blank");
			}
		});
		new JQuery("a[href^='#']").click(function(evt) {
			var j = new JQuery(evt.currentTarget);
			var anchorTarget = j.attr("href");
			new JQuery("body").scrollTo(anchorTarget,500,{ onAfter : function() {
				js.Lib.window.location.hash = anchorTarget.substr(1);
				new JQuery(anchorTarget).attr("tabindex",-1).focus();
			}});
			evt.preventDefault();
		});
		if(JQueryS.browser.msie && JQueryS.browser.version == "6.0") {
			haxe.Timer.delay(function() {
				new JQuery("#menu>ul>*").css("display","inline").addClass("grid_3");
				DD_belatedPNG.fix(".png");
				new JQuery("#menu .floater").css("marginLeft",getFloaterTarget(true));
			},500);
		}
		if(org.casalib.util.QueryStringUtil.getValue("debug") == "true") {
			new JQuery("body").keydown(function(evt) {
				if(evt.keyCode == 80) {
					new JQuery(".print").css("backgroundImage",(new JQuery(".print").css("backgroundImage") == "url(image/print-s.gif)"?"url(image/print.gif)":"url(image/print-s.gif)"));
				}
				else if(evt.keyCode == 81) {
					js.Lib.alert(Main.cursorOnMenu);
				}
			});
		}
		if(new JQuery("body").hasClass("page-home")) {
			new JQuery(".gallery-tip").fadeTo("fast",0.9);
			var tmp = new JQuery("#gallery-thumb .thumbs a");
			var thumbsWidth = tmp.eq(0).outerWidth();
			new JQuery("#gallery-thumb .thumbs").width(thumbsWidth * tmp.length);
			new JQuery("#gallery .thumb-next-btn").click(function(evt) {
				new JQuery("#gallery-thumb").scrollTo("+=" + thumbsWidth * 4,800,{ axis : "x", easing : "easeInOutQuad"});
				evt.preventDefault();
			});
			new JQuery("#gallery .thumb-prev-btn").click(function(evt) {
				new JQuery("#gallery-thumb").scrollTo("-=" + thumbsWidth * 4,800,{ axis : "x", easing : "easeInOutQuad"});
				evt.preventDefault();
			});
			new JQuery("#gallery-thumb .thumbs").tabs("#gallery_images > .image",{ effect : "fade", fadeOutSpeed : "slow", rotate : true, onBeforeClick : function(event,tabIndex) {
				Main.showingImage = tabIndex;
				new JQuery("#gallery-thumb .floater").animate({ marginLeft : new JQuery("#gallery-thumb a").eq(Main.showingImage).position().left - 20},{ queue : false, easing : "easeInOutQuad"});
				var thumb = new JQuery("#gallery-thumb");
				var scrollLeft = thumb.scrollLeft();
				var targerScrollLeft = thumbsWidth * Main.showingImage;
				if(scrollLeft + thumbsWidth * 4 <= targerScrollLeft || targerScrollLeft < scrollLeft) {
					thumb.scrollTo(targerScrollLeft,800,{ axis : "x", easing : "easeInOutQuad"});
				}
			}}).slideshow({ autoplay : true, interval : 6000});
			new JQuery("#gallery-thumb .floater").css("cursor","pointer").click(function(evt) {
				new JQuery("#gallery-thumb .thumbs").data("tabs").click(Main.showingImage);
				evt.preventDefault();
			});
			var studentNews = null;
			var teacherNews = null;
			var onNewsXmlLoaded = function() {
				if(studentNews == null || teacherNews == null) {
					return;
				}
				var items = [];
				studentNews.find("item").each(function(i,e) {
					var j = new JQuery(e);
					var date = Date.parse(j.children("pubDate").text());
					items.push({ pubDate : (date == null?"":DateTools.format(date,"%Y-%m-%d")), title : j.children("title").text(), link : j.children("link").text(), group : "student"});
				});
				teacherNews.find("item").each(function(i,e) {
					var j = new JQuery(e);
					var date = Date.parse(j.children("pubDate").text());
					items.push({ pubDate : (date == null?"":DateTools.format(date,"%Y-%m-%d")), title : j.children("title").text(), link : j.children("link").text(), group : "teacher"});
				});
				items.sort(function(item0,item1) {
					return (item0.pubDate < item1.pubDate?1:-1);
				});
				var jItems = new JQuery("#news .items");
				var tmpl = new haxe.Template(jItems.html());
				jItems.html(tmpl.execute({ items : items}));
				var newsScrollPane = function() {
					new JQuery("#news .items").jScrollPane({ scrollbarWidth : 5});
				}
				newsScrollPane();
				new JQuery("#news .symbols>*").css("cursor","pointer");
				new JQuery("#news .symbols .student").click(function(evt) {
					new JQuery("#news .symbols>*").css("font-weight","normal");
					if(Main.showingNews != "student") {
						new JQuery(evt.target).css("font-weight","bold");
						new JQuery("#news .items .student").slideDown("fast",newsScrollPane);
						new JQuery("#news .items .teacher").slideUp("fast",newsScrollPane);
						Main.showingNews = "student";
					}
					else {
						new JQuery("#news .items>*").slideDown("fast",newsScrollPane);
						Main.showingNews = "all";
					}
				});
				new JQuery("#news .symbols .teacher").click(function(evt) {
					new JQuery("#news .symbols>*").css("font-weight","normal");
					if(Main.showingNews != "teacher") {
						new JQuery(evt.target).css("font-weight","bold");
						new JQuery("#news .items .teacher").slideDown("fast",newsScrollPane);
						new JQuery("#news .items .student").slideUp("fast",newsScrollPane);
						Main.showingNews = "teacher";
					}
					else {
						new JQuery("#news .items>*").slideDown("fast",newsScrollPane);
						Main.showingNews = "all";
					}
				});
			}
			JQueryS.ajax({ url : "http://www.cityu.edu.hk/edge/newsStudents.xml", dataType : "xml", success : function(data,textStatus,XMLHttpRequest) {
				studentNews = new JQuery(data);
				onNewsXmlLoaded();
			}});
			JQueryS.ajax({ url : "http://www.cityu.edu.hk/edge/newsTeachers.xml", dataType : "xml", success : function(data,textStatus,XMLHttpRequest) {
				teacherNews = new JQuery(data);
				onNewsXmlLoaded();
			}});
			var link = new JQuery("#event-calendar");
			var iframe = new JQuery(("<iframe src=\"" + link.attr("href")) + "\" id=\"event-calendar\" noresize=\"noresize\" frameborder=\"0\" border=\"0\" cellspacing=\"0\" scrolling=\"no\" marginwidth=\"0\" marginheight=\"0\" allowtransparency=\"true\"></iframe>");
			link.replaceWith(iframe);
			iframe.height(340);
			var categoriesWidth = new JQuery("#projects").outerWidth();
			var handleWidth = new JQuery("#projects .category .handle").outerWidth();
			var categories = new JQuery("#projects .category");
			var categoryWidth = categories.eq(0).outerWidth();
			var categoryNum = categories.length;
			var switchToCategories = function(tagetIndex,animation) {
				if(animation == null) animation = 400;
				if(categories.eq(tagetIndex).hasClass("current")) return;
				new JQuery("#projects .categories .current-indicator").hide(0);
				categories.filter(".current").removeClass("current");
				categories.each(function(index,element) {
					var j = new JQuery(element);
					if(index < tagetIndex) {
						j.animate({ left : index * handleWidth},{ queue : false, easing : "easeInOutQuad", duration : animation});
					}
					else if(index == tagetIndex) {
						j.addClass("current").animate({ left : index * handleWidth},{ queue : false, easing : "easeInOutQuad", duration : animation, complete : function() {
							new JQuery("#projects .categories .current-indicator").css("left",index * handleWidth + 20).show((JQueryS.browser.msie?0:200));
						}});
					}
					else {
						j.animate({ left : (categoriesWidth - (categoryNum - index) * handleWidth) - 10},{ queue : false, easing : "easeInOutQuad", duration : animation});
					}
				});
			}
			new JQuery("#projects .category .handle").each(function(index,element) {
				new JQuery(element).click(function(evt) {
					switchToCategories(index);
					new JQuery(evt.currentTarget).children(".bg-hover").fadeOut("fast");
				}).prepend(new JQuery("<div class='bg-hover'></div>"));
			}).hover(function(evt) {
				var cur = new JQuery(evt.target);
				if(!cur.parent().parent().hasClass("current")) {
					cur.parent().children(".bg-hover").fadeIn("fast");
				}
			},function(evt) {
				var cur = new JQuery(evt.target);
				cur.parent().children(".bg-hover").fadeOut("fast");
			});
			switchToCategories(0,0);
		}
	});
}
Main.prototype.__class__ = Main;
$Main = function() { }
$Main.__name__ = ["@Main"];
$Main.prototype.__class__ = $Main;
$_ = {}
js.Boot.__res = {}
js.Boot.__init();
{
	window.JQuery = jQuery;
}
{
	window.JQueryS = jQuery;
}
{
	window.JQueryEvent = jQuery.Event;
}
{
	var d = Date;
	d.now = function() {
		return new Date();
	}
	d.fromTime = function(t) {
		var d1 = new Date();
		d1["setTime"](t);
		return d1;
	}
	d.fromString = function(s) {
		switch(s.length) {
		case 8:{
			var k = s.split(":");
			var d1 = new Date();
			d1["setTime"](0);
			d1["setUTCHours"](k[0]);
			d1["setUTCMinutes"](k[1]);
			d1["setUTCSeconds"](k[2]);
			return d1;
		}break;
		case 10:{
			var k = s.split("-");
			return new Date(k[0],k[1] - 1,k[2],0,0,0);
		}break;
		case 19:{
			var k = s.split(" ");
			var y = k[0].split("-");
			var t = k[1].split(":");
			return new Date(y[0],y[1] - 1,y[2],t[0],t[1],t[2]);
		}break;
		default:{
			throw "Invalid date format : " + s;
		}break;
		}
	}
	d.prototype["toString"] = function() {
		var date = this;
		var m = date.getMonth() + 1;
		var d1 = date.getDate();
		var h = date.getHours();
		var mi = date.getMinutes();
		var s = date.getSeconds();
		return (((((((((date.getFullYear() + "-") + ((m < 10?"0" + m:"" + m))) + "-") + ((d1 < 10?"0" + d1:"" + d1))) + " ") + ((h < 10?"0" + h:"" + h))) + ":") + ((mi < 10?"0" + mi:"" + mi))) + ":") + ((s < 10?"0" + s:"" + s));
	}
	d.prototype.__class__ = d;
	d.__name__ = ["Date"];
}
{
	String.prototype.__class__ = String;
	String.__name__ = ["String"];
	Array.prototype.__class__ = Array;
	Array.__name__ = ["Array"];
	Int = { __name__ : ["Int"]}
	Dynamic = { __name__ : ["Dynamic"]}
	Float = Number;
	Float.__name__ = ["Float"];
	Bool = { __ename__ : ["Bool"]}
	Class = { __name__ : ["Class"]}
	Enum = { }
	Void = { __ename__ : ["Void"]}
}
{
	Math.__name__ = ["Math"];
	Math.NaN = Number["NaN"];
	Math.NEGATIVE_INFINITY = Number["NEGATIVE_INFINITY"];
	Math.POSITIVE_INFINITY = Number["POSITIVE_INFINITY"];
	Math.isFinite = function(i) {
		return isFinite(i);
	}
	Math.isNaN = function(i) {
		return isNaN(i);
	}
}
{
	js.Lib.document = document;
	js.Lib.window = window;
	onerror = function(msg,url,line) {
		var f = js.Lib.onerror;
		if( f == null )
			return false;
		return f(msg,[url+":"+line]);
	}
}
{
	js["XMLHttpRequest"] = (window.XMLHttpRequest?XMLHttpRequest:(window.ActiveXObject?function() {
		try {
			return new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch( $e0 ) {
			{
				var e = $e0;
				{
					try {
						return new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch( $e1 ) {
						{
							var e1 = $e1;
							{
								throw "Unable to create XMLHttpRequest object.";
							}
						}
					}
				}
			}
		}
	}:(function($this) {
		var $r;
		throw "Unable to create XMLHttpRequest object.";
		return $r;
	}(this))));
}
org.casalib.util.StringUtil.WHITESPACE = " \t\n\r";
org.casalib.util.StringUtil.SMALL_WORDS = ["a","an","and","as","at","but","by","en","for","if","is","in","of","on","or","the","to","v","via","vs"];
haxe.Template.splitter = new EReg("(::[A-Za-z0-9_ ()&|!+=/><*.\"-]+::|\\$\\$([A-Za-z0-9_-]+)\\()","");
haxe.Template.expr_splitter = new EReg("(\\(|\\)|[ \\r\\n\\t]*\"[^\"]*\"[ \\r\\n\\t]*|[!+=/><*.&|-]+)","");
haxe.Template.expr_trim = new EReg("^[ ]*([^ ]+)[ ]*$","");
haxe.Template.expr_int = new EReg("^[0-9]+$","");
haxe.Template.expr_float = new EReg("^([+-]?)(?=\\d|,\\d)\\d*(,\\d*)?([Ee]([+-]?\\d+))?$","");
haxe.Template.globals = { }
haxe.Timer.arr = new Array();
haxe.Unserializer.DEFAULT_RESOLVER = Type;
haxe.Unserializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
haxe.Unserializer.CODES = null;
haxe.Serializer.USE_CACHE = false;
haxe.Serializer.USE_ENUM_INDEX = false;
haxe.Serializer.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
org.casalib.util.ArrayUtil.SORT_CASEINSENSITIVE = 1;
org.casalib.util.ArrayUtil.SORT_DESCENDING = 2;
org.casalib.util.ArrayUtil.SORT_UNIQUESORT = 4;
org.casalib.util.ArrayUtil.SORT_RETURNINDEXEDARRAY = 8;
org.casalib.util.ArrayUtil.SORT_NUMERIC = 16;
js.Lib.onerror = null;
DateTools.DAYS_OF_MONTH = [31,28,31,30,31,30,31,31,30,31,30,31];
Main.currentPage = [];
Main.showingNews = "all";
Main.showingImage = -1;
Main.cursorOnMenu = false;
$Main.init = Main.main();
